Talk about a reversal of fortune.

Until recently, investors were positively star-struck by drug companies that could raise prices indiscriminately, letting their patients struggle to pay the freight. Lauded for a laserlike focus on shareholder returns, companies like Valeant Pharmaceuticals International, a multinational specialty drug company based in Quebec, received high marks and even higher valuations from besotted shareholders.

Now, however, investors are beginning to see the peril in such a business model. Sure, price jumps may generate earnings and stock gains, but when the enrichment of a few comes at the cost of many, unwanted scrutiny often follows.

Hijacked drug prices blasted to the forefront two weeks ago after a report in The New York Times told the story of how Martin Shkreli, the chief executive of the privately held Turing Pharmaceuticals, bought Daraprim, a 62-year-old infectious disease drug, and immediately raised its price to $750 from $13.50 a tablet.

When a firestorm ensued, Mr. Shkreli accurately noted that his was not the only company to acquire a drug and then send its price into the stratosphere.