On the trails I run, the right of way is Horse, Runner, Bike (i.e. bike yields to walker/runner yields to horse). 2 things I've been told by riders through various trails and errors passing horses on trails:
1) Talk to the rider from as far back as you can in a relatively normal voice (doesn't have to be fancy conversation - just a "Runner behind you. How's it going?" etc.) I'm told this puts the horse at ease and avoids startling the rider if they don't hear you approaching. Apparently if you talk, horses think you're human, but if you don't talk horses think you're a predator and startle.
2) Slow down and walk past while talking to the rider. Generally the rider will rein in the horse and hold it stopped while you walk by. Once you get a few feet past, a simple "have a nice day." and then take off back to your normal pace.
These things can be frustrating if you're trying to tempo, but getting kicked in the face or having to stop because a rider gets thrown would be a lot more frustrating. Keep in mind that a horse, unlike a mountain biker, is an animal and doesn't really have a "polite" button. They just react to their survival instinct.