I learned to pedal faster. About 15 miles into my usual bike ride, I used to always get chased by two dogs, one pit bull. I quickly learned that no matter if I was tired, I needed to get a second wind when riding up that long hill where the dogs lived.
Around here, riding through the neighborhoods, if a dog comes out running at me on my bike. I stop the bike, get off and introduce myself. I am amazed at the difference a shift in my attitude makes. The dogs are much happier when I stop to visit. Some, even follow me around for a while when I get back on my bike.