Here's what I've found works in an escalating order scenario:
1) Try saying in a high pitched voice, "Hey, boy!" or "Hey there girl!" If they react positively, the say, "Gooooood Boy." or "Goooood Girl, in a lower, soothing voice.
2) If 1 doesn't work, squirt with a water bottle (but be forewarned, I once had a dog that doing this sent into a full-tilt vicious rage).
3) In the old days, the next level was to whack them with a frame pump but nobody uses those any more.
4) Kick them in the chops. Make sure you are accurate or you may get a punctured calf muscle.
5) Last resort (only if a single dog): get off bike and keep it between you and dog and use the bike as a shield and/or a weapon.