Here's what I wrote in a similar thread over on TFL
Argh..every once in a while one of these threads pop up, and I have to respond.
First some background: For the past 12 years I have trained German Shepherds for Schutzund Sport, and worked with trainers from all over the world, also worked with many K-9 officers, and trainers of personal protection dogs.
The problem is, most people (and I wouldn't expect them to) are not able to "read" a dog, meaning to infer its intentions based upon its actions. Due to my experience I can. And very often a dog that most people think is being aggressive, isn't. In particular, just because a dog is barking or even growling DOES NOT mean it has bad intentions. I have a 125 lb GSD that is very vocal, and loves people....He will run up to you and bark his fool head off...That's just how he communicates...He barks at ME all the time, when he wants something. Growling WITHOUT showing teeth is similar. If dog is growling AND raising its lips to show teeth, this is more serious. If ears laid back and tail is down, AND dog is growling, it is in a defensive/aggressive posture. BUT that does not mean it will attack, however, this is when you should worry.
OK, without getting long winded a couple things NOT to do:
DO NOT RUN (you didn't which is good)--this can trigger a "prey response" in many dogs and they will chase and possibly bite.
STAND YOUR GROUND--If its a "territorial" dispute, if you let the dog "win", it will now gain confidence, and continue to advance, where it might not before. And, yes, they can "smell fear", and will react to that (if you're afraid there must be a reason, so they will more likely consider you a threat).
DO NOT injure the dog, i.e. with a stick or pepper spray, you'll probably just piss it off, and THEN get bit when you might not have otherwise. This might work, it might not, but don't take the chance. Dogs, like many people WILL defend themselves, if attacked. Dogs threshold for pain is VERY high (based on experience with using electronic collars with some of my dogs...One of them worked through a electric shock generated by an $1800 German collar, that delivers a jolt similar to a taser.) I can also show you police (raid)reports where a dog absorbed multiple pistol hits(Pit Bull, 4 9mm hits, finally being put down by a shotgun at point-blank range). and kept coming.
Personally, I know
A) I can scare the crap outa even the "toughest" dog you're likely to find most places
B) I also know (from experience) how to fight a dog "hand-to-hand" so to speak
And C) most people DON'T know these things so don't try 'em at home!
Please, I'm not "defending" dogs, but know from experience that 99% of dog bites are in some way "provoked" (though not intentionally), and avoidable, so I try to educate people as much as possible. I know I'll get flamed, but what the heck.....And, yes, I've been bitten multiple times, and it was ALWAYS my fault, 'cause I did something I shouldn't have.