There's a thorough discussion over at crazyguyonabike of this topic.
I am a believer in the "Alpha Dog" method.
About 99% of all dogs are "all bark" and as soon as you pass by their yard they lose interest.
It's the other 1% that you have to worry about - even though their owners say things like,
"Oh - - he won't bite." That is if the owner is anywhere to be seen.
What this requires is a super-tough attitude. If you have doubts - get the doggy spray.
You jump off your bike towards the dog - not away.
You bellow in your loudest, meanest voice -
"I'm gonna kick you face in so deep you'll be barking out your - - - - !!!"
And you keep heading TOWARDS the dog - preferably with air pump or something else raised.
If you keep at it - the dog will ALWAYS drop his ears.
Once he does this you have to continue. Still forceful.
"Now GET BACK in your yard!!!"
When you turn around to go back to your bike, they will usually try again.
But a quick spin on your heels and another bellow will reproduce the servile position immediately.
I have been charged by some nasty-assed dogs and it always works.
Best - J