Frankly I'd just say the horse needs to be desentitized more, especially if all the dog did was bark and run at it. My mare doesn't much bat an eye at my border collie running up behind her, swinging from her tail, running right under her.
Now if some stranger dog came up and acted aggressive, she'd give them a hoof to the face. One of her favorite games is 'let's trample the dog' which we actively play any time some stranger dog comes around getting in our way.
Just was well, bringing my own dog along with me when riding helps too. She runs loose, she runs all the coyotes and foxes we might see. She also keeps back other dogs, she'll either fight them or just distract them until the horse and I are farther away.
Edit to add that I agree with the above poster, driving the dog away is a much better method than just shooting it just because it spooked your horse.