I don't really think there's a one-size-fits-all solution to dealing with dogs. Depends if you're on your territory, their territory, neutral territory, what breed/size it is, whether you've got your own dog with you or not, whether you've got steel toecaps or sandals on etc etc.
Also depends on whether or not you know enough about doggy body language to tell overexcited/boisterous from nervous/aggressive from plain old mean, untrained and used to getting its own way. Also depends on whether or not you're giving off waves of fear.
If you're confident with dogs and a nervous/aggressive dog confronts you on neutral territory, chances are you could face up to it firmly and shout NO and it would run off suitably chastened. But if you're actually scared of dogs and just bluffing confidence with a bossy dog on or near its own territory, you will likely end up being badly bitten.
Sometimes just staring at a dog is enough to make it think again. If a dog is eyeballing you, don't look away. Most dogs take that as a sign of submission. Though that advice doesn't really apply to a small furry cannonball launching itself at your ankles at a hundred miles an hour.
Some dogs are a real nightmare. Almost always the owners fault not the dog. 
Edited: 04/08/2012 at 13:50