Like KSH said, squirting them in the face with water, and standing my ground has always worked for me - it takes them by surprise. A lot of dogs chase you because they think you are running from them, so if you turn the tables on them they'll back down. Of course, that is just the dogs I've encountered, which doesn't mean they'll all behave that way. I'm sure there are some out there that are just plain mean, I just haven't run into them. We used to live on a road that had 3 houses within about 1/2 mile, all with anywhere from 2 to 5 dogs. Try riding past that! The little ones at the first house would alert the big ones, alerting the ones at the next two places, all of whom would be waiting for me! I'd try to get to the first house as quietly as possible, moving as fast as I possibly could. They were mostly really nice dogs, but I was game to them when I was on my bike. When I run, I usually have to pet all the dogs I meet anyway, but if I meet an aggressive one, I stop and show I'm not afraid (which also means he doesn't perceive me as running away from him).

Hopefully the owner of the dog that came at you will think about what happened and learn from it.