how do they get doctors to prescribe the patented versions if they aren't better?
This phenomenon is quite well-documented so I won't cite sources here.
https://www.vice.com/en_us/article/pg7ez9/pharma-reps-are-ba...
Example:
Great discovery: PDE5 inhibitor helps with erectile dysfunction. Product: sildenafil (Viagra). After the mechanism was invented, tadalafil (Cialis), and vardenafil (Levitra) were pushed into market and FDA approved. There are roughly different 10 PDE5 inhibitors and the market is saturated.
More tricks here: https://hbr.org/2017/04/how-pharma-companies-game-the-system...