How to calm a dog down

You hear a snarl and a bark as you jog down the sidewalk, and suddenly a dog is running at you. It’s a large animal, perhaps half of your own weight, and you’re instantly frightened. From the way it is approaching, you feel sure it’s going to bite.  What do you do...