Goddamnitsomuch, I hate this meme... You're either a troll or supremely ignorant.
Doctors don't make ANY money from writing prescriptions. They never have, aside from the days of yore when doctors personally purchased the ingredients to mix up and sell*. Even then, it wasn't long before chemists/pharmacists took that over.
They can bill for exams, tests and procedures, but in the USA, Canada, UK and (AFAIK) all of Europe, they don't get anything for writing a prescription. NOTHING. They don't even get to bill for the paper it is written on (which has security features and can be surprisingly expensive).
There have been some rare (and I mean rare) cases of kickbacks from pharmaceutical companies to doctors. The only examples I know about are for chemotherapy drugs costing thousands of dollars per dose, e.g. an oncologist getting money for putting all his patients on drug A over competitor's drug B, which wasn't necessarily cheaper or more effective. The people involved were caught fairly quickly and punished severely.
This only happened because the base cost of the drug was very high (many chemo drugs are wickedly hard to make), the markup is high (to recoup massive development costs), AND the market is small (Only oncologists treating a specific subset of cancer patients, possibly only a few thousand people). The profit of a handful of additional sales was enough to tempt people into breaking the law. The odds of this happening with mass market drugs are practically nil. No doctor is going to take that kind of personal risk unless there is significant money involved, and a company is not likely to spend that money and take a huge legal risk to drive sales of XYZ antibiotic up from 500,000/year to 500,100/year.
Seriously, this meme needs to die. As for getting gifts and other non-money compensation, in the USA, drug companies aren't even giving out free pens and post-its anymore, and that wasn't done based on number of prescriptions written anyhow.
*Snake-oil salesman were/are sometimes doctors, and thus could have "prescribed" something to the scam victim, but it's not a traditional doctor/patient relationship.