B: He was always playing tricks on other boys. Finally they decided to give him a dose of his own medicine.

A: Well, he should have seen it coming.

Note: The idiom means “being treated in the same way you treat others.” We also say to “get/have a dose of one’s own medicine.” It’s probably inspired by a story in “Aesop’s Fables.” A cobbler who’s not very good at making or repairing shoes finds himself losing business. So he roams to another town to start a new practice as a doctor. One day, the cobbler becomes ill and the people try to feed him the medicine he’s been dishing out to others. Refusing to take his own medicine, he has to tell people the truth.