There are two main reasons why a dog would vomit every morning after a long night's sleep or a period of fasting. The first is pregnancy, but this usually clears up after the puppies are born. The second is bilious vomiting syndrome, also known as reflux gastritis, which can happen to both genders, all breeds and often afflicts dogs who have other digestive problems such as pancreatitis.
The dog should have no other symptoms other than vomiting up a bit of white or yellow foam every morning upon awakening. If the dog has other symptoms, such as extreme panting for no known reason, cringing, dizziness or diarrhea, then the condition is more serious and needs prompt veterinary attention.
The stomach can no longer tolerate the large build up of stomach acid that occurs during a long night's sleep. Since there isn't any food in the stomach at this time, there isn't any buffer for the acid. Exactly why the stomach can no longer tolerate a certain amount of acid is unknown. It could be that the stomach was somehow damaged during a previous illness, such as colitis, vital infection, parasites or pancreatitis.
Unless other symptoms develop, vomiting bile once a day is not considered anything harmful. According to Animal Hospitals USA, giving the dog a snack or small meal late at night may help. It is thought that the food helps to buffer the stomach acid that is irritating the stomach.
According to "Dog Owner's Home Veterinary Handbook," dogs can vomit from stress. If the dog predictably vomits in the morning after the same event--such as vomiting right when the owner is getting ready to go to work--then treatment needs to work on getting the dog to relax around whatever is stressing it out.
In bilious vomiting syndrome, the dog only regurgitates white or yellow foam. If the dog is bringing up any other matter, then a vet needs to be notified immediately. The foam should just drop out of the mouth and not shoot out in an arc. The latter can indicate a major medical problem.