My solution is generally to scream and pedal faster. A friend of mine was chased and bit by a little dog on her first real bike ride as an adult. I find that smaller dogs tend to be the more frequent offenders. Their owners think they're so small they can't do much damage so they're not as "on the ball" with training. Cute and slightly dangerous.