When riding with friends, keep a safe distance between horses, whether riding side by side or in a line. When riding single file, keep at least a horse's length between horses. One easy way to judge the distance is to look between your horse's ears at the horse in front of you. If you can see the hind hooves, then you are at a safe distance. If you can only see the hocks, back off.
If you tailgate or ride up on the rear of another horse, you may be kicked, or your horse may step on the other horse's heels.
When riding side by side, some horses may try to kick. Be on the lookout for warning signs such as pinned ears and swinging their hind end toward the other horse.
Source: University of Missouri Fact Sheet G2881 “Saddling, Bridling & Riding the Western Horse”
