Recently I have bungee corded an air horn to the stem so it is easy to reach. Twice on country rides I have had dogs come out chasing me, barking, and a blast or two from the air horn has been enough to surprise or startle the dog enough to stop them (both from the chase and even from barking). Much less invasive than the pepper spray (which I have for a last resort) and has the added benefit of being effective to ward off wildlife in the road as well as alert a driver backing out in front of me.
Anyone else tried the air horn?