Yep, from the code: People ahead of you have the right of way. It is your responsibility to avoid them.
Doesn't get more clear than that. Yes, people ahead will make stupid moves, will cut across without looking uphill, will suddenly stop without looking uphill, and sometimes, they'll crash! How dare they.
I treat skiing the same as driving--defensively, always alert to what's going on around me. But I don't have rear view mirrors, nor does anyone else on the hill. So I do my best to give a very wide berth when overtaking people and will typically slow down for a minute. I've also been known to clack my poles to alert them that I am there. Again, they don't have eyes back there, but I sure hope they can hear me and don't have earbuds in. I never assume that they CAN hear me, but it can't hurt to alert them.
Anyway, massive thread drift. It's rather alarming the number of folks who don't know the code. Remember, it's no skin off anyone's nose to slow down and overtake someone slowly. It's a lot of skin off everyone's nose if you overtake too fast and end up hurting possibly BOTH people.