If a dog charges you, snarling and threatening to bite, your instinct is probably to run. Your fight or flight response kicks in, and most people try to put as much distance as they can between themselves and the threat.
The problem with doing this is that you're not going to outrun an aggressive dog. All you're going to do is delay the attack by a few seconds. Moreover, dogs tend to have a very strong prey drive, meaning they want to chase something that is moving away from them. Running can actually get them more riled up and make the situation worse.
Instead, you're better off to stay calm and refrain from acting aggressively at all. Try to talk calmly to the dog. If you start walking away -- which you should -- do it slowly and keep facing the dog. This way you can look down at it the entire time.
You're not necessarily trying to show the dog that you are in control. Instead, you're just trying to show it that you don't want to fight. You're not the aggressor. You don't want to "invade" the dog's territory. If you slowly back off while acting like this, the dog will see that you are not a threat and will probably let you go without injury.
Of course, if you do get bitten, it's not because you did anything wrong. Owners have a responsibility to restrain their animals, especially if they have shown a pattern of this behavior. You may be able to seek financial compensation for your injuries.