If it's a frequent problem, you could use Halt! spray.
Getting chased is scary. I was chased for the first time a month ago by some smaller dogs, but they were so wimpy I was able to scare them off by screaming at them. This was at about 12:00 AM on a rural road though, so it scared the **** out of me.