When this happens to me I do one of two things depending on my mood.
Most of the time I just take my foot off the accelerator and slow down about 20 below, bonus if it's a no passing zone . Occasionally I return the favor after they pass.
If I'm in foul mood though, I will hit my brakes...hard. It's always good to inspire a little fear in the masses.
All I can remember when I was a learner is I sat next to a somewhat stupid girl, and someone ran up and smacked the buildings window on Halloween.