I have just a few questions:
-what kind of dog and how old is he
-how often does this occur
-is he having difficulty breathing
-is he vomiting
I think I can help you with just a little more information.
Based on this information, it sounds like your dog may be nauseous, and having thick saliva is a good indication of this. If he starts vomiting, having difficulty breathing, develops diarrhea, or becomes lethargic, I would have him seen by a veterinarian. If he is just nauseous, the thick saliva will go away when that resolves.
Hope that helps.