I was out the other day going up a hill and three large dogs slipped through their fence and came after me. Usually I don't worry too much about dogs but this time one of them seemed like he was serious. So I stopped, got off the bike and guess what all the big mean dogs did? Ran away! Immediately. Also, when I got back on the bike, they didn't come back.
I think that what cyclists trigger in dogs is a predator-prey response. If you stop and get off the bike, you stop being seen as prey. Anyway, I'm going to start using this as a standard technique whenever I get a sense that a particular dog is going to do something more than bark. If it doesn't work and I do have to defend myself, I'm much better able to do so off the bike, especially if I am in on a hill or in somoe other spot where I can't outsprint the dog.
I do a lot of riding in remote rural areas where there are many unleashed dogs. Last month one of my friends got seriously bit by a dog on a club ride.