I don't have much time to post before the next class, but when you've got ten companies trying to develop the same drug, some of them are going to lose out without a profit, but the r&d for that failed drug need to be covered somehow. Add to that doctors prescribing more and more name brand drugs when they're not needed due to financial kickbacks, marketing, etc and the cost can really get racked up.
Some drugs simply don't have generic equivalents due to patents, so it isn't entirely on the doc. Most I've seen try to take the patient's insurance into consideration and will use Epocrates, Medscape (everyone has it on their phones these days) to look up generics.
There are also issues with prescribing some name brand drugs simply because they have to be given. Some of the higher cost drugs are prescribed because they only have to be taken once daily, whereas a lower cost drug may have to be taken 2 or 3 times. Seems silly, but a lot of patients don't, won't or aren't taking their meds, so limiting it to 1 requirement vs 2-3 requirements per day can help.
As to the different companies developing different drugs, it can be a tricky investment. The worst, and there is a recent example I'll give, is when there are many companies making the same drug, but no FDA approval and no standardization.
Standardization and FDA approval can effectively give one company rights over the drug, and the prices can skyrocket. Which is bogus, but... hey, government control, right?
I found it amusing that so many groups backed sole FDA approval for Makena, and then the company jacked prices.
Luckily, the FDA will allow, in this case, compounding pharmacies to still make their own.
Makena price drop: Drug maker lowers price of Makena pregnancy drug - Los Angeles Times