I usually try telling the dog to go home or to get back, etc.
If my talking fails, and the dog gives chase, I will use pepper spray, which is very effective and seems to teach the dog to leave me alone. At least, sprayed dogs rarely bother me a second time.