Offsetting R&D costs and directing R&D are a policy problem, and a completely different beast. The antibiotic resistance crisis is in front of us, yet the big returns are in cancer, with the additional wrinkle being that what is needed is new antibiotics of last resort. That's a problem of a kind that the market cannot solve.
Also: generic shortages. Generics are a low-margin business with maybe 6 suppliers workdwide. If one facility goes off-line for this or that reason there's going to be a shortage, and slack capacity is punished by the market. Right now the cisplatin shortage is in the news, and again the market is no help.