A plague doctor was a medical physician who treated victims of the plague. They were specifically hired by towns that had many plague victims in times of epidemics. 
Since the city was paying their salary, they treated everyone: both the wealthy and the poor However, some plague doctors were known for charging patients and their families extra for special treatments and/or false cures. 
They were not normally professionally trained experienced physicians or surgeons, and often were second-rate doctors unable to otherwise run a successful medical business or young physicians trying to establish themselves. 
These doctors rarely cured their patients; rather, they got a count of the number of people contaminated for demographic purposes.