I love a rural ride and dogs are part of the fun. Most just want to go for a run so I play along and even egg them on a bit. A spontaneous sprint will do you both good.
A dog senses fear and fear makes them nervous, often more aggressive. I have a small canister of pepper spray velcro'd in easy reach (for canine training, of course) and I've never had to spray a dog twice. There's also a snubby .38 in a fanny pack, if a dog ever takes me off my bike, it'll never happen again. I was a bike cop and had a bad roadie habit for awhile. Only dog that's taken me off my bike was a Yorkie, he insisted on "chasing" me from in front, was too quick for me to go around.
I ran over and killed the little buggar. I put the chain back on my bike, tried to console his hysterical owner, and rode on. Sad day for this dog lover.