Blah... I love dogs, but not when biking. Had a few bad experiences when biking the TransAm but was never hurt and eventually got good at dealing with them. Purchased some spray about 3/4ths through the trip but never used it.
Anyways, the mistakes I made was being afraid and not confronting the dog head on. My advice is that when you hear a dog coming at you (they'll always bark before approaching) just look at and yell at it strongly. Most just want to chase you and have some fun. If yelling at it does not work, just take your frame pump and raise it like you are going to hit the dog, most will cower since they've probably been hit like that before. After a while it kind of gets fun messing with them, like speeding at them or egging them on.