I've had some dogs come rushing out in the street barking at me when riding my bike - I just leave them in the dust. Some have looked pretty ferocious and got my heartbeat up. I have some of that pepper spray but have never used it.
When I was in junior high a friend had a paper route. I would substitute for him when he was sick or just needed someone to cover for him.
One family had a dog that was not secured that would chase me on my bike and try very hard to bite me on the back of my ankle. I couldn't just ride away because I had a cul-de-sac to deliver papers into and the dog lived at the opening of it. The dog wouldn't chase me into someone else's yard, just in the street.
I just did the best I could do to avoid it until one day I saw the folks who owned the dog in their front yard. They were highly amused at my plight.
That's when I decided I didn't want to be nice anymore. I picked a house with a steep driveway and went up to its top, then turned around and headed back out towards the street. I picked up speed as fast as I could. The dog came running across the street to intercept me. At the last moment I changed my trajectory and kicked the living daylights out of that dog's jaws. It went staggering around, whimpering and completely stunned.
The dog never bothered me again. Bullies are like that, aren't they?
Maybe there was a better way to stop the problem, but given the (lack of) quality in its owners, I doubt it. I was just a kid and made the best decision I could to save myself from harm, so I don't feel bad about it.