To treat somebody with a dose of his own medicine.

以其人之道还治其人之身