The general concensus based on different threads I have gleamed suggests the following:
Against untrained/feral dogs:
1. Run away if possible.
2. If not, stand your ground.
3. Place your back against a wall or a tree if possible.
4. Wrap your offhand with your shirt/jacket/coat if time permits.
5. Be sure to have your defensive tools ready.
6. Pray that they back off.
Defense against a trained dog is essentially the same except that rather than praying, you scream for the owner, who is hopefully nearby, to command the dog to stop. Otherwise, don't bother waiting for the dog to get too close. Just attack at the first opportunity.