Although the free market is a great tool for providing the public with the best, cheapest TV set, washer/dryer or car, maybe it doesn't work for healthcare, which is part of the reason countries with "socialized" medicine end up with much cheaper care and comparable results.
Many of the elements that make a free market efficient are simply not present in healthcare :
1) The person making the decision to consume a certain drug or medical procedure (doctor) is most often not the person paying for it (patient or insurance co). Often, the person making that decision doesn't even know the cost of the drug or procedure or at worst, is in conflict of interest.
2) People are not rational agents when it comes to healthcare : When facing death or suffering, most people will be willing to spend fortunes on things that only offer very marginal benefits. Few people would buy a car that is 10 times more expensive but gives you 5% better odds of surviving an accident. Yet when it comes to pharmaceuticals, such a marginal effect is enough for a drug to become the new guideline (especially in oncology), no matter the cost of that drug.
3) Reliance on ever longer patents : succesful lobbying and tinkering with certain molecules have allowed pharmaceutical to prolong the patents on blockbuster drugs. The prices are then arbitrarily set by these pharma co (see the Shkreli case) who rarely have to justify themselves. Competition only enters the picture when generics are allowed, often only after decades.
4 ) Limited ability to compare options : Altough it is always possible to get a second opinion for elective operations or treatment fo chronic diseases, that is simply absent for all urgent care. Furthermore, most people do not know enough to adequatly compare the different options available to them and simply rely on the authorithy of a trusted healthcare provider (which again is often in a position of conflict of interest).
Furthermore, patients have the most expensive healthcare in the world in the US, but we are ranked 31, and below many countries in terms of patient outcome. It's not working for the vast majority of Americans. It just isn't.
This is why healthcare in general, including drug development and production, should be managed by the state, that has an interest in having the healthiest population for the least amount of money, instead of simply higher profits for the shareholders.