You might be inclined to do one of several things if you were in my position. You might stop to see if the dog would calm down if you were on your feet and not on a bike and you could easily position yourself between the bike and the dog to keep it at bay while you waited for the owners to take control of their dog. I did this once while touring in the Olympic Peninsula but my bike was too heavy to move in front of the dog. Fortunately the owner was on the street quickly before anything happened.
You might try to out run the dog. I was coming from a complete stop so I couldn't really do this.
You might grab your full size frame pump, if you happen to carry one, and I do, and whack the dog in the nose. The problem with this is that you might knock yourself off the bike while doing so, which might put you in a bad position with the dog, who you might miss whacking. You might also be violating a law that protects canines in hot pursuit. This likely depend on what state you are in. In Massachusetts, you are allowed to take extreme measures to protect yourself from a dog:
Any person may kill a dog which suddenly assaults him while he is peaceably standing, walking or riding outside the enclosure of its owner or keeper.
But that seems much too extreme for me. I would avoid this alternative, unless you were really physically threatened by the dog.
The fourth, and I think best approach is to spray the dog with water. If the timing is right, you will have water in your in one of your bottles when a belligerent canine is heading your way. The trick is to get some speed - you need to have the canine breathing hard when you spray it. Once you have speed, squeeze your bottle in the direction of the dog's face. You are aiming for its eyes. If you are lucky, you will nail the offender and it will cease its pursuit while it figures out what just happened.
That's what I did today and the pooch did stop and reassess its intentions. Fortunately the road was mostly empty and while I didn't stray into the opposite lane, I did occupy the full lane. There was a sympathetic driver coming my way who understood what just transpired. It happened pretty fast, probably within 6 or 7 seconds. I saw the beast, I accelerated, I pulled out my water bottle, I aimed and squirted water towards the beast, and I was safe.
For those who might wish to avoid the untamed brute, avoid slowing down at the intersection of Frost Street (Route 3A) and Lawndale Street in Tyngsborough, MA.
It's been a long time since I had a dog chase me. The incident in the Olympic Peninsula was in 1989. In 2000, I was riding in the southwest US when a dog gave chase. Unfortunately for the dog and fortunately for me, there was a lane of traffic between us and the dog did not consider that the lane might be occupied when it crossed the lane. It was.