As far as I can tell, you will never really be able to avoid it when riding in hot weather. To reduce or minimize it, be sure you're doing the following:
- Start hydrating before your ride. Like, hours before.
- During the ride, drink before you feel thirsty. Taking frequent little sips is better than big guzzles at longer intervals.
- Electrolytes need to be replenished as well. This will not prevent cotton mouth, but it's related to the topic. I like Gatorade Zero (not the original, sugary formula). There are also powders you can mix into your water. My favorite of these is Skratch.