Weigh the situation. Sometimes it is better to seem rude and say nothing than to risk scaring the bejeesus out of someone, especially if there is no risk of collision anyway.
I was going past an elderly neighbor lady's house and noticed she was out in her garden near her grape arbor. Thinking she had seen me I gave her a big shout "Hulloooo!", which usually gets a smile and a similar response. This time, tho, she bent over right when I passed and had her butt towards me, and when she heard me holler she snapped upwards and around and smacked her head on the grape trellis.
I couldn't help but giggle (she was ok) and because of it I am sure there is a hot little cell in hell with my name on it.