I squirt them in the face with my water bottle. It stuns them enough that you can sprint away. I did have one dog that actually jumped up and clamped his jaws on the tip of my drop bar. One of those that would chase me every ride. He was just hanging there while I was riding and I had to kick him off haha. His teeth tore holes in my bar tape. Later in the day I drove to the owners house and told the lady that next time I was going to call the police. Never saw that dog outside again.