I am often accosted by territorial dogs when biking. I often confuse them dreadfully by saying, very gently - "Nice doggie" when they come charging out.

If that doesn't work, and they become truly aggressive, then it is time to consider the quar -, er, hiking staff.
_________________________
Geezer in Chief