Diarrhea is a very common condition in guinea pigs. But it isn't usually serious and can be remedied quickly with the right kind of treatment.
Guinea pig diarrhea is liquid and sometimes runny, and always soft. It is very distinguishable from regular feces which are rounded and hard. Diarrhea is often accompanied by a number of other symptoms. You might notice that the cavy isn't eating as much as usual, is showing signs of pain in the stomach area and is having trouble getting through daily activities.
If you find that the diarrhea is very frequent or that it smells really bad, you should rush your pet to a vet immediately. This might be a severe case and you should treat it urgently; in such a time, you might also find the pig feeling very weak or inactive.
Diarrhea is usually caused by indigestion due to eating the wrong food, and isn't too hard to treat. However, it can also be caused by a host of other factors which, although not as common, pose a real threat. One of these causes is parasites: bacteria or fungus can sometimes be ingested with food and cause diarrhea.
Ironically, diarrhea can be also caused by medication. If your pig is currently being treated for any condition with drugs, those may very well be the cause as well. One other common cause is not eating enough hay. Hay is extremely important in maintaining the digestive health of your guinea pig and a shortage of it will almost certainly lead to diarrhea.
The first thing to do is stop feeding your pig fruits and vegetables. Until the diarrhea is gone, the pig should mostly eat timothy hay (with maybe some food pellets) and drink lots of water. You should personally make sure that food and water are being ingested, or hand-feed if necessary. It is essential to keep the pig fed and well hydrated at this time.
If you haven't already, you should be filling your cavy's cage with an abundance of fresh hay; this is vital is containing the diarrhea. Some of the hay might have gotten spoilt and might have caused the problem in the first place, so if you can, you should replace all the hay with a fresh batch.
You should be able to see a drastic improvement within a day. If you don't, take it as a serious condition and see the vet immediately.