What is wrong with your guinea pig when there is a red thing coming out of the guinea pigs anus?

Genitalia for guinea pigs are located very close to the rectal area. It sounds as though the guinea pig is a male, experiencing arousal. Many times, the pet will also drag itself along the ground/floor, releasing an odor to be detected by its female counterpart, for mating purposes.