Pepper spray.
I also like the idea of a horn.
A dog charging is a lot different than a dog being aggressive. I've been charged more times than I can remember, but never attacked (me). I've had my dogs attacked briefly... but that would not warrant shooting another dog. It's all fixable, even at that point.
I would have to say that before I shot a dog, I would have to believe it were going to attack, and do serious damage (breed specific). I would certainly draw, and be ready, under such circumstances. But the dog would have to cross a point of no return (such as lunging with intent to bite).
If I otherwise shot every dog that ran at me, that would be a large number of dogs.
I would dread the fallout from shooting a handgun on a public street and killing someone's dog, or worse, missing and having an errant bullet hurt a person.
You have no clue how the owner will react, for right or wrong.
Feuds with persistent, nefarious neighbors really bites. Poisoned animals, vandalism, rocks through front windows, slashed tires, gets emotionally draining, and expensive. And it's often impossible to prove the vandal.
I've been victimized by problem neighbors in the past and trust me, it's not worth it. Ultimately, someone has to move to get it peaceably resolved. Long story short, make and maintain great neighbors. You don't want the emotional headaches, the dollar costs of any issues, the bad blood, etc.
As a dog owner, and I love my dog(s), I can say that no matter what precautions you take, short of chaining them to a tree, they can and do sometimes get free and run. They can be escape artists. And I would be livid if someone shot one because it ran up to them. I would be mad AT THE PERSON because their shooting my dog would be a massive over-reaction.
My advice, take over an appropriate baked goods or other dish, have a talk with them. Peace offerings. Explain your concerns of their loose dog. Perhaps even offer to help them build a fence some Saturday, or get them one of those $10 stakes with a cable that can sink in the ground, or a cable they can tie to the tree...
A few dollars in prevention will certainly go a long way.