Hi. I'm Dr. Gotthelf. I have been a vet for 35 years and I would like to use my experience to help you with your pet's medical problem.
When dogs are throwing up white foam, that is usually swallowd saliva and mucus, which comes from swalloing it. The problem is not the vomiting, but the excessive production of mucus. It could be that the air is dry and the liquid secretions are thickening. THere may be something like a draining sinus or a sore throat causing increased mucus production.
I have two recommendations for you to try before going to the vet. First, place the dog in a bathroom and run a hot shower for 10 minutes so he can inhale warmed humid air for a while. That will hydrate and loosen up the mucus. Second, dogs do not digest mucus well unless there is some acid in the stomach, so offer him several small meals throughout the day. Often when they eat, they produce acid in the stomach and that helps the mucus break up and pass through the stomach into the intestines.
Thank you for your reply I will try both and will keep an eye on him. I tend to lower the ac may be too much at night and that may be causing the problem.