Among all the hazards cyclists face, few are as ubiquitous as man's best friend. Wherever you ride, whatever you ride, whether on road or on dirt, at some point a dog will conclude you are persona non grata, or worse, decide a pound of your flesh might make a fine hors d'oeuvre. Remember, like a cheetah after a gazelle, even the fastest dogs lack endurance for long distance chases and will eventually give up as long as you keep moving.
Discretion is the better part of valor, and avoiding injury to either party is the goal here.
Remember that some dogs bark and chase for fun with no intention of attacking. The faster you and your feet are moving, the less likely you are of being bitten. Aggressive approach Yelling at the dog will usually startle it, making it cease and desist long enough for you to safely escape. Physical violence and pepper spray should only be used in extreme cases. In such circumstances, it is advisable to keep your bike between your body and the dog.