Establish a government monopoly for purchasing drugs. A painkiller costs maximum X or the government won't subsidise it. A drug to heal a disease costs maximum Y. People will spend everything they have to save their lives, even when it's to the detriment to the rest of society - There's a limited set of medicine available, and it's funnelling society's resources into the pharmaceutical industry because everyone's trying to compete for the best drug. Eventually people will work their whole lives to save up just so their parents can live 2 more years when they're 75, and that's not really good for society. Living out years isn't the end goal, enjoying what time we have is. An appropriate government institution will ensure that happens, while providing sufficient drug supply (but not as much as if everyone spent their life savings on drugs and nothing much else).
That's how it works in many countries outside the U.S.
For example, https://en.wikipedia.org/wiki/Pharmac