Being chased by a roaming dog looking for trouble can be humiliating, terrifying and frustrating since those curs don't know when to mind their manners, and people often make matters worse by running away.
Brendan Leonard from the Adventure Journal says running is a bad idea because dogs instinctively chase anyone who runs from them, so it's better to stop, turn around then flip the f$%k out on the dog.
According to Brendan staying calm and barking back at a dog trying to chase you down may confuse the dog and diffuse the situation:
What the dog has not seen is a human being going FREAKING CRAZY on it. Which is what you're going to do. For one second. When the dog realizes you have completely lost your shit, it will be shocked. You are unstable, possibly dangerous. And, ideally, the dog will stop chasing you.
I've seen the power of standing still diffuse a situation with an aggressive dog that was chasing my friend and I, but I certainly wasn't thinking about barking at the vicious Rottweiler as it sniffed my butt and tried to figure out why I didn't run away. Longest three minutes of my life...