Just remaining calm, avoiding eye contact, and continuing on my way was all I needed to do. If they started charging, I pretended to pick up a rock from the ground and feigned throwing it at them. That usually spooked them enough to leave me alone. If that didn't work, actual rocks were used. There was one time when a dog wasn't deterred by either the pretend or real variety, and lunged to bite me. I used a backpack as a shield and employed a flurry of kicks to keep the aggressive canine at bay. It finally relented and I went on my way unscathed.
If you ever encounter a hostile pooch that's out for blood, here's how to walk away with jugular intact.