Is bear spray too cruel for dogs that chase you when cycling?
Yes. Instead, mix equal parts vinegar and water into a spray bottle set to "stream" that you keep dangling from your handlebars or into a squeezable water bottle you keep in a water bottle holder. As an aggressive dog approaches, spray the dog in the face. If you can, you should stop your bike and dismount on the side away from the dog before attempting this maneuver. Anyway, the vinegar won't hurt the dog, but it will essentially render the dog blind as the vinegar will completely take over the dog's sense of smell. Unlike humans, dogs' primary sense is smell, not sight. A dog that has temporarily lost its ability to smell will instantly halt any attack. This is a way to effectively thwart a dog attack without harming the dog or putting the dog in pain. By the way, bear spray is like pepper spray. It' hurts. Spraying a dog with it could just serve to make it angrier if only a little bit gets on him. Furthermore, if you have the nozzle pointed the wrong way, you could end up spraying yourself. You could also end up having some of it blow back on you by the wind. That's why it's bear spray. If you're being attacked by a bear, certain death is imminent, so it merits the risks. Dogs are much smaller, even big dogs, than bears and don't present anywhere near the level risk that a bear does, making something like bear spray not your best option, which is why it's not called dog spray.
What I've found to be most effective is ammonia/water mixture. Mix 75% ammonia and 25% water. Put the mixture in a water pistol; that can't be mistaken for an actual firearm. Shoot while on your bike don't dismount unless you have to. Many large breed dogs can jump very high and can move very fast. This is why putting your bike between the dog and yourself may not offer much protection. Shooting while riding with the water pistol can cause the dog to hesitate just long enough to get away from it. With small dogs one may be able to simply outrun it. However, I once had a 140 lbs German shepherd guard dog. This size dog can kill a human. Bela is right about disrupting the sense of smell and pepper spray getting on you as well but is wrong about the amount of injury a large breed can inflect. Once you've gotten away call animal control. With large breeds you have to be more concerned about your safety than harming the dog.