Pepper spray (cop strength...not the watered down "Halt" variety). A shot or two to the nose and eyes can help to "train" all but the dumbest of dogs not to chase cyclists.
I've used it plenty of times on dogs, and it always causes them to cease chasing immediately. It's easy to carry in a jersey pocket, and can also provide some degree of protection from two-legged varmints.
Note: I'm a dog lover, and would never shoot or poison one. But I will use pepper spray on dogs that chase me on the bike. FWIW, it doesn't seem to hurt them very much (no whimpering or yelping)...they just stop chasing and head for tall grass to rub their muzzles.
Note 2: get the "stream" style of pepper spray, not the "fog" style. It lessens the chances of blowback due to wind.