As others state, it often helps to stand your ground, identify yourself as a human by yelling "NO!" , "DOWN-, "BAD DOG!" and/or "HEY DOG NO!" repeating as necessary, pointing at the dog and either lifting a rock or stick and pulling your arm back as if you were going to throw it, or pretending like you are going to throw something.
Your shouts might alert the owner, who might call the dog back away from you.
If you have time and access to things to throw, throw them.
Most dogs seem interpret the sight of a human about to throw something at them ingrained in them as a universal threat.
Continuing to run will not help.
It always helps to identify and say something to the owner, as long as you are not putting yourself in more danger by doing so.
Report irresponsible dog owners to authorities by getting the address and a photo/description of the dog, and /or a photo description of the owner.
The above works with most dogs, but not with encounters with trained attack dogs.