I was told by some experienced riders that you are supposed to say something as you go by someone so they don't think you are showing off or trying to "one-up" them. It still irks me a bit but now I look at it is as them trying to offer encouragement or be polite. Still, if it's a tour or big organized ride everyone should expect to pass and be passed so I don't think anything needs to be said unless you think the person needs help.