If you see a dog coming, stop running and cross your arms across your body and neck and stand still. It's important to remain calm and don't make any sudden movements; do not speak to the dog or make eye contact. I know this is really tempting but any kind of interaction you make is rewarding the dog for their behaviour and they will want more.
In most cases, if you do not engage at all with the dog it will soon lose interest and walk off to find something ( or someone) else to bother.
Keep an eye out for signs of aggression such as growling, snarling and baring teeth and if the dog starts to attack you, drop to the ground and curl up into a ball face down with your hands over your ears (to protect them from being bitten).
Try not to scream or shout as this will cause the animal to become more aggressive. Do not try to wrestle with the dog.
If the owner of the dog does not come immediately, stay on the ground and wait until they do. Do not attempt to make an escape or run away as this will encourage the dog to chase you down as they think you want to play with them.
Heaven forbid, but if you are injured, try not to move, even if it is painful. Wait until the owner comes then when the dog is restrained you can tend to your injuries or seek emergency care if needed. It's advisable to get a tetanus jab if you are bitten, just in case.
If you need to you can report the dog and owner to the local authority dog warden (localdirect.gov.uk). You don't have to be actually bitten to do this, and it doesn't matter what breed the dog is either. Under Section 3 of the Dangerous Dogs Act (1991) a dog is deemed 'dangerously out of control' if 'there are grounds for reasonable apprehension that it will injure any person'.