Barrels, cows, racing friends -- These are all things that can hype a horse up fairly easily. When you ride, don't make it stressful for the horse. You want your horse to be able to walk nice and free and long, but still be able to snap back up for speed if you need it. When your horse starts to get tense and jig, keep yourself calm and collected and keep his feet moving, but give him a place and try and get his mind on you. Try some half halts and start asking him to bend, circle and pay attention to your leg rather than just let him trot forward. If you can, try and get him to come back down to a walk rather than pushing him forward into a trot.
It's going to take a bit of patience, but let your horse realize that everytime you ride, it's not going to be a race. Try and let him relax and losen up and calm himself so he can focus on you, not which direction he's going to take off in.