Dogs actually have a well functioning digestive system and dog diarrhea is not a common experience. But I know that when my dog has diarrhea I can usually attribute it to something that could be an avoided. Some of the common causes of diarrhea in dogs are:
Dietary disruption - Suddenly switching your dog from their regular food to a new food can cause diarrhea. A dogs digestive system gets used to a particular diet and as such changing them over to a new food should be done gradually and over a period of time. The best way to avoid your dog getting diarrhea is to introduce the new food slowly by mixing some of the new food with their old food. Over a period of days mix more of the new and less of the old so eventually all they are getting is the new food. This is particularly important if you are attempting to switch a puppy from one food to another as they have very delicate digestive systems.
Worms - Worms can cause diarrhea and is a common cause of it in puppies. If this diarrhea is frothy this usually an indicates internal parasites. Get treatment for this at your local Vet.
Stress - Any departure from the normal routine, like a long trip or a new baby in the house, can cause diarrhea.
Illness - An illness in some cases your dog might just have a virus or an illness. Although this doesnt happen in dogs as often as people you should have your Vet check him out if you suspect this is the case so you can get him the appropriate treatment.
Bad food - Your dog is just like a member of your family. Make sure you take care of your dogs diet as you would a member of your blood relatives, by avoiding spoiled meats.
Here are some things you can do to help when your dog has diarrhea:
A little castor oil may help if your dog's diarrhea was caused by eating spoiled food. If you need a stronger remedy, you may have to switch to feeding him plain rice.
Milk thickened with arrowroot is sometimes also worth a try.
Keep your dog on the rice and milk diet for a couple days to give his system some recovery time and then gradually put him back on his regular food.
Gradually work for your way back towards normal food by including boiled hamburg or white fish boiled in milk in with the rice. If you notice the diarrhea starting up again go back to the previous level.
I am always worried first and foremost about my dog's health when my dog has diarrhea, so my first step is always to call the vet. I advise that any pet owner do this. Your dog might not be happy about a visit to the vet, but better safe than sorry. Your vet can give suggestions about how to help your dog and may even prescribe medications to speed recovery along.