Mostly, its best to just ignore a barking or chasing dog and go your merry way. I think the conventional solution for a dog that is actually attacking is pepper spray. Of all solutions, peper spray is probably the most effective, lowest weight, most legal, and least likely to land you in prison or in a fist fight with the dogs owner.
I never had vicious dogs after me. When I did have repeat issues with dogs chasing me, I considered these options. I was mostly worried about high speed collisions because the house was at the bottom of a steep hill. These dogs would come running out in the road in front of me when they heard me coming.
Stop and confront them - It was somewhat gratifying to chase them back into their yard, but didn't actually prevent the event from happening the next day. In fact, I think it encourages the continuation of the daily game.
Carry a can of spray paint - I didn't actually do this. I think it would work, though. These were nice looking dogs. I figured if they came home with orange paint in their coats, the idiot owners would restrain them.
Urinate in their damn driveway - I'm the alfa. The top dog. I urinate in your space it becomes my space. That's right. I'm marking my space. This seemed to work. I don't think it intimidated the dogs as planned. Maybe the owners decided I was psycho and decided to fix their invisible fence before I burned the place down.