Caution wrote:
Step 1. Is the dog's tail wagging? If it is don't worry, the dog just wants to play, just ignore it.
Step 2. If it's tail isn't wagging, sprint directly toward the dog, screaming. This will scare 95% of dogs away
Step 3. If the dog is still coming at you, you're f***ed, try and kick it.
I agree with this post. Also, I find that in general if you aren't encroaching on a dog's territory (yard and sidewalk in front of house), I find they won't mess with you. Typically when I see a dog that's not on a leash out in a yard, I either cross to the opposite side of the street or run a little further towards the middle of it before I come across the house.
If a dog is coming at you or barking and you suddenly speed up or slow down, it will typically take that as an invitation to chase you or as sign of aggression. I usually just keep my pace the same, pretend I don't notice the dog, and the damn thing will lose interest pretty soon.
But if a big dog comes after you, tail straight up, and is well off of it's owner's property, look for something to hit it with (rock, stick, metal piping), and turn around brandishing it and yelling. You are legitimately in danger at that point, and if you need to kill an attacking dog, the owner has no one but themselves to blame for not controlling their animal.