In addition to the other excellent suggestions here, you might consider an Air Zound air horn, if you can stand the fred factor. I have one on my bike now after fracturing my pelvis when two dogs ran right out at me on the road a couple of years ago. Better fred than dead (or in the hospital, having surgery to patch up a bone or several!)
Most dogs are very startled by the horn and stop running long enough for you to get the heck out of dodge if you're on the flat or going downhill.
That said, I don't hesitate to stop and use the other methods mentioned here if the dogs are in front of me or I'm climbing when I see them.
Good luck!
Emily
Emily
2011 Jamis Dakar XC "Toto" - Selle Italia Ldy Gel Flow
2007 Trek Pilot 5.0 WSD "Gloria" - Selle Italia Diva Gel Flow
2004 Bike Friday Petite Pocket Crusoe - Selle Italia Diva Gel Flow