I usually talk my way around someone on the trail..."Hi. I'm coming around on your left here. Nice day, isn't it?" It works pretty well with less experienced cyclists, hikers, etc. I don't yell, just start talking well in advance of the pass. I'm thinking of investing in an incredibell. They make a pleasant little "ding."
Today I was crossing a bridge in town. Normally a 4-lane bridge, it is closed down to 2 lanes for construction. When all of the lanes are open, I use the traffic lanes. For the duration of the work project, I'm using the sidewalk. Today as i crossed the sidewalk, I encountered a woman pushing a baby carriage. I COULD have ridden by her. I KNEW that I had enough room. She didn't know that however. I got off the bike and walked past her. We both smiled and said "Good morning."
I dismount for horseback riders too. Step off the trail, smile and say "hi." I don't like having my rhythm broken, but, this is just the right thing to do.
Whenever you encounter other trail users, remember that you represent all of us. My 3 rules: Be safe. Be friendly. Be polite.
__________________
Religion is a good thing for good people and a bad thing for bad people. --H. Richard Niebuhr