I wouldn't bother with an air horn. Most dogs will retreat if you hell at them in a stern and loud voice. Or they'll at least retreat long enough to buy you a bit more time to get away or dismount and shield yourself with your bike. Shouting and a squirt of water from a water bottle (carry one for just this purpose since you use a Camelback) will usually do the trick, at least in my experience.

Now dogs that ambush you are simply tough to deal with. I've had some come pretty darn close. All I could really do in that adrenaline rush was yell and sprint. I'm not sure I'd have the presence to grab anything, even if it was easy to reach.