If he is retching and foaming at the mouth, but unable to produce vomit, he may have a condition called Bloat or GDV. This is very, very serious, and requires immediate attention. Is his belly getting bigger?
If he is just nauseous and trying to vomit, that is not an emergency. He may have gotten some food he was not supposed to have, or not used to eating. Take away food and water for 4 hours, then gradually give water and food in small amounts as long as the vomiting does not continue. If the dog is still vomiting later tonight, bring him to the vet tomorrow.
If at anytime your dog is having trouble breathing, painful abdomen, or cannot vomit but keeps retching, or gets very lethargic, please get him to your vet ASAP.
If you feel my answer was helpful, please click on ACCEPT. Feedback & Bonuses are always welcome. If a deposit has been made, it remains with Just Answer until you press ACCEPT. Once you press ACCEPT then I am paid.
If there is something I can further clarify, Click REPLY. Our dialog continues even after you click accept, I want to be sure your question is fully answered.