HI Curly
My Alex has ongoing issues with "foam" which is exactly as he describes it. It has improved over the past 2 years but is particularly obvious when he is tired or has been talking alot.
I understand the mechanisms of many drug actions, including how cough medicines work, so when we discussed the cough medicine as a possible solution, it made sense to me that it should be an expectorant. There are two sorts of cough medicines. One is a "suppressant" which dampens down the cough reflex and is mostly recommended when you need to stop a cough (usually because it is keeping you awake at night and hurts). The other medicine is an "expectorant" which makes it easier to cough the gunk up by making it less viscous and sticky. In Australia, Robotussin is a brand that contains a suppressant, which goes against what I think you are trying to achieve (unless you DO want to stop the cough). Formulations differ from country to country so check this with your pharmacist first. Explain to the pharmacist that you want to thin the mucous or make it easier to cough and he/she may recommend a better alternative.
Having said all that, neither of these worked for Alex. To this day, he wakes with a dry mouth that develops into foam the second he starts talking or drinking.
Alex's saviour has been the Water Pik and as ChristineB suggests, done at the lowest speed. Alex also found that slightly warmed water (tepid) was good. Pandora also warned Alex that he should close his eyes to what came out of his mouth. I would second that suggestion and add "close the bathroom door" to the advice

.
This method of "foam" control works for a couple of hours, and Alex uses his water pik before he goes out.
Alex is peculiar in that he is the only one I know of who has "foam" as an ongoing issue (although now I read that there is one other), so yours is likely to go away in time as for most people.
Also, I would like to reiterate what others have already said - it DOES get better. It is important you keep reminding yourself of this, so you know the frustration (and possibly self consciousness) you are currently experiencing will be but a memory in a few months time