I had something similar happen recently. When the sheep were moved into pastures this fall, I was jogging with my three dogs and saw a LARGE dog that guards sheep(larger than a Pyrenees, in fact the tallest dog I've ever been up close too) come toward us. We were about 1/4 mile away when we first saw it and I instantly turned around and headed the other way hoping it would hold it's ground. I stopped jogging and just walked.
It was gaining ground quickly and loping toward us. I said a silent prayer to protect us and my dogs, since my husband told me earlier that week about how a sheep rancher told him his dog attacks and kills other dogs. It wasn't retreating and it was almost to us and I decided it was better for us to meet it, than for it to think we were retreating, so I turned around and started walking back in the direction toward the dog just as it was meeting up with us.
We meet up and it was acting dominant/excited to my dogs. Ignored me for the most part. My dogs aren't normally aggressive and they knew their place with this one. It towered over them. It was accosting my dogs, while my dogs were mostly submissive. Tails down, backs hunched while we continuing walking. This dog was trying to get on my dogs backs, aggressively sniff their tails, and trying to get them to run. It had a wild look in it's eye.
I ignored it and just looked and walked straight forward, but a couple times when I could hear a scuffle start, I would yell, "Hey!" and it would stop.
I was walking around a huge 4 mile block and decided if we could just get past the sheep part he would stop accosting us. I was worried if I turn back it would see that as a sign to go after us and if we stopped that would start a fight. As we got closer to the turn in the road, another one came out toward us. It looked more like a Pyrenees, it was relatively smaller and was barking and more vocal. This one kept it's distance more and would stay about 7-10 feet away from us and kind of lunge in and out. To this one I talked in a soothing voice as we kept walking, even though I was literally ready to crap my pants. I told the dog we weren't going to hurt their sheep and it was OK. They kept it up for probably 1/2 mile until a rancher came by and helped chase them back to their sheep.
I really don't know if I handled the situation the right way or not. But I'd probably handle it the same way whether with my dogs or not.
I still want to go back and get a picture of that dog, just so people could believe me about how big it was.