Dictionary.com
Thesaurus.com

get a dose of one's own medicine

Cultural  
  1. To receive the same unpleasant treatment one has given others: “Bart got a dose of his own medicine when everyone in the office started playing practical jokes on him.”