This past week we were on a 3 night Inn to Inn tour. Twice we had dogs come at us and both times I stopped with the bike between me and the dog and yelled "go get your ball". I've done this before and it took the dogs by surprise, they stopped and looked around...not sure what to do. I suppose it depends on the dog. The last time a boxer and golden retriever ran out to the road and i yelled to get your ball, the golden stopped and looked confused as it is a retriever while the boxer stopped at the road as I kept saying no. One constant in it all is that I always had the spray ready.
I once read on another forum "maybe we should carry treats". Please do not start this practice. It only teaches the dog to come out to the road/biker for treats.