These are the two ways I found that helped me with my barn sour horse.
Riding away from the barn the minute he acts up we head back to barn and lunge. I mean lunge as in make it a hard work out!!! When he settles and is listening to you get back on and try to walk him down the path you originally wanted to go. If he acts up again repeat process. Do not give him treats do not tell him he is a good boy until you get to your goal spot. Ride a little bit past that then turn back.
The other thing I have done which worked better for me was to work on bending. Everytime he would try to turn back we did a good amount of bending until he showed he was actually doing the right thing then continue down the road. Next time he did it we would bend again. However the way he turns his head to turn back is not the direction you want to bend him..you want to bend him the opposite way that his body orignally tries to turn. Keep that up until you reach your destination. Again do not praise him for anything until you get him to where you want to go.
You can also try getting off of him where ever he acts up and lunge him in that place.but again no encouragement until you get to the place you want to go.
But I also worked him in a roundpen before hitting the trail practicing with him to focus on me. If he cried out for another horse he had to bend when I was on him or if I was on the ground he had to change directions and work. Once I was comfortable he understood both those were his way of having to work veruses just relaxing then when we hit the trail it was a bit easier to control his sourness and control it to move on.
Edit: also on the way back my trainer made me focus on making sure my horse didn't pick up his pace. If he did without me asking we turned back around and headed back down the trail until he calmed down then turn back for home. The minute he picks up speed we turn back around..etc etc. the horse should only move as fast as you want him to no matter what direction you are going.