I have dealt with this problem in a few regards. I shoot the dog when he is near enough to me, in his attack run, to be certain that I won't miss! Point blank range!
If I am not packing I crouch down low and grab him by the throat when he lunges, picking him off of the ground and strangle him until he is unconscious.
Then I finish him off & leave him where I killed him, for the owner to find & dispose of!
_________________________
QMC, USCG (Ret)
The best luck is what you make yourself!