OK, I've done my best to avoid responding to this, but after reading a lot of really questionable responses, I can't resist--sorry.
First off, I understand a fear of dogs, having been attacked as a child myself. I didn't get over it until I ended up adopting a very large, very mean "looking" dog--and learning a lot about dog behavior in the process.
Having a dog chase you is no laughing matter, and can definitely cause an accident, and is a problem that needs to be addressed. However, the main issue would be you tangling with the dog and crashing, not being mauled by the dog. My first recommendation would be to contact the dog's owner, the local animal control officers, or the police. It's as unsafe for the dogs as it is for you.
Remember, in almost all instances, the dog is just herding/chasing/playing by chasing you, and is doing so out of boredom. Throwing a treat seems like a good idea to me, I'd try that first. Otherwise, the squirt in the face with a waterbottle isn't a bad idea, but you'd be safer just to keep riding, unless you're awfully coordinated. Bear spray/mace?? Save that for the irresponsible owner--this very well could just incite an otherwise docile dog to start biting, and really, your biggest worry is not crashing!! Taking your hands off the bars to grab mace/bear spray/pellet guy is just stupid, IMHO.