I do mostly rural riding and have found 90%+ of the dogs that chase me are just having fun. Took me some observation time to confidently predict which the 10% are. One last year wasn't fazed by pepper spray, scary one there, came right up to the bike while I was dismounted and showed every intent to attack, even with a face full. Next time I came that way, I had a BB pistol and let him have it, very painful but not strong enough to penetrate skin. Never saw that one again.
I think I have my worst problems with the smaller ones, have come pretty close to running a couple over. If you have time, the water bottle works.