One slice of the economy that has been relatively resilient is the drug industry. Pfizer PFE and Merck, two of America’s largest pharmaceutical companies, on Thursday reported second-quarter results that solidly beat Wall Street’s expectations. That followed similarly strong earnings from Bristol-Myers Squibb BMY on Wednesday.

It seems people aren’t likely to cut down on their Covid-19 pills or cancer treatments anytime soon.

Yet that doesn’t mean investors shouldn’t worry about drug companies’ growth. One looming problem for the pharma industry is a surprise deal in Washington this week that could for the first time allow the government to negotiate drug prices. That would come as many of the biggest companies are confronting a looming patent cliff, meaning their blockbuster drugs will soon face competition from cheaper generics.

Get The New York Times and Financial Times Digital Subscription Combo 77% OFF

Sen. Joe Manchin agreed on Wednesday to back a package aimed at lowering carbon emissions and curbing healthcare costs. The deal, negotiated privately between Mr. Manchin and Senate Majority Leader Chuck Schumer, contains several provisions that could take a bite out of pharma industry sales, including one that allows Medicare to negotiate some prescription-drug prices.

Merck Chief Executive Robert Davis said on an analyst conference call that the legislation would effectively set the price of some drugs and would be “highly chilling on future innovation.” Still, he said some form of price pressure had long been anticipated in the U.S. and the company is adequately prepared to maintain its growth trajectory.

Get The Wall Street Journal Newspaper | WSJ Newspaper | WSJ Print Save 30% Off

For now, the company is delivering on that pledge, handily beating Wall Street estimates with $14.6 billion in second-quarter sales, up 28% from a year earlier, and adjusted earnings per share of $1.87, compared with analyst estimates of $1.73 per share.

But cancer drug Keytruda, which accounted for $5.25 billion of second-quarter sales, will lose patent protection by the end of the decade, putting pressure on management to deploy its cash toward deals. The Wall Street Journal reported in recent weeks that Merck was weighing the purchase of Seagen for about $40 billion.

Pfizer is facing an even tougher challenge when it comes to its longer-term growth. On a quarterly basis, the company’s results look stellar, with its Covid-19 vaccine and antiviral Paxlovid treatment bringing in almost $17 billion in sales, beating analyst consensus for the two products. Total revenue was up 47% to $27.7 billion, also ahead of Wall Street expectations.

Yet if one strips out Covid-related products, Pfizer’s other revenues are shrinking, at $10.78 billion versus $11.18 billion last year. And because there is very little visibility on how long it can maintain such astronomical sales numbers for its Covid products, Pfizer is one of the cheapest large-cap drug companies, trading at 8.5 times next-twelve-months earnings versus a 14.8 industry average, according to FactSet, that is itself at a discount to the broader market.

Get The New York Times and The Economist Epaper 3 Years

Given its lack of exposure to economic fluctuations, pharma remains a decent place to hide for investors concerned about a possible recession. Over the longer term, though, the tough question is how much faith to put in Merck and Pfizer that they will continue to find future blockbuster drugs. If their record is a yardstick to go by, both will keep doing deals, with Pfizer in May announcing the $11.6 billion purchase of Biohaven. The company has plenty of room in its balance sheet left for more acquisitions.

With at least a portion of future sales facing pressure from Washington, looking for other sources of growth has become even more important.