You need the magical "Good Dog" socks my SS gave me after I was chased a long distance by a big scary, non-barking dog.

In my experience, if they're barking, yell sternly and they'll go home. If they're not barking, ride as fast as you can. During my big chase, the last thing I wanted to do was stop or get off of my bike. The dog was only about 4 or 5 ft off of my rear wheel. It would've bitten me before I could get my bike in front of me, I'm pretty sure. I do, however, think that putting the bike between you and the dog is good advice. The bike should protect you.

My solution is to ride in town where yelling at the dogs to go home is usually sufficient.