Most people love a bargain; investors do too. Purchasing shares of companies that can perform well over long periods is already pretty exciting, but it's even more so when they can be scooped up from the discount bin. And there's no need to wait for a major stock-market meltdown to do that.

Stocks facing company-specific issues for which the market has punished them -- but from which they can recover -- offer attractive bargain opportunities. Here are two great examples to consider: Merck (MRK 0.43%) and Bristol Myers Squibb (BMY 1.07%). These healthcare specialists are down 16% and 17% this year, respectively. But they remain excellent long-term investment options, especially at current levels.

Pharmacist talking to patient.

Image source: Getty Images.

1. Merck

Merck is fast approaching the loss of patent exclusivity for Keytruda, its biggest growth driver by far. The cancer medicine should start facing biosimilars in the U.S. by the end of the decade. Although that still looks far away, drugmakers must plan for major patent losses years in advance. And Merck could face non-biosimilar competition before that, including from Summit Therapeutics' promising therapy, ivonescimab.

These upcoming challenges are weighing on the stock, but for long-term investors, Merck remains attractive at its current levels. The company's subcutaneous (SC) version of Keytruda has already produced positive phase 3 results. This new formulation of the medicine will help extend its patent exclusivity into the next decade while taking on many of the original's indications.

Why would the SC version find any success at all compared to the original, intravenous formulation? The answer is that SC Keytruda is easier and faster to administer. In a phase 3 study, it reduced the time patients spent in the administration chain and in the treatment room by 49.7% and 47.4%, respectively. It also simplified things for physicians, reducing the time they spend preparing and administering the medicine by 45.7%.

Expect the new version to be massively successful, just like the old. And although ivonescimab could pose a challenge, it will take a long time for that medicine to get approvals and label expansions across the range of Keytruda's long list of indications.

Meanwhile, Merck will continue to innovate. The company's brand-new approvals include Winrevair, a medicine for pulmonary arterial hypertension, and Enflonsia, a vaccine for the respiratory syncytial virus (RSV).

Merck has a deep pipeline and generates substantial revenue and profits. It also offers a reliable dividend program. And the stock's forward price-to-earnings ratio was recently just 9.1, compared to an average of 16.3 for the broader healthcare industry, which includes companies other than pharmaceutical stocks. Merck's shares might be down significantly this year, but there is plenty of upside for investors willing to stay the course.

2. Bristol Myers Squibb

Bristol Myers Squibb is facing the same problem, with the upcoming U.S. patent expiration for its cancer medicine Opdivo. And over the past few years, it has had to deal with the loss of patent exclusivity for Revlimid and Sprycel, two cancer drugs; the former used to be its top-selling product.

Revenue moved in the wrong direction in the first quarter due to recent patent cliffs, but the company is also making terrific progress in the right direction. In December, BMS earned approval for a subcutaneous version of Opdivo, which will help mitigate the losses it will incur when that product faces biosimilar competition.

Since 2019, BMS has secured a number of new approvals. One of the most important from that bunch was Reblozyl, a medicine for anemia in patients with beta-thalassemia. The company's growth portfolio, composed mostly of newer products, is doing well. In the first quarter, total revenue decreased by 6% year over year to $11.2 billion; however, the growth portfolio recorded sales of $5.6 billion, up 16% compared to the year-ago period.

The drugmaker also has a robust pipeline that is expected to yield additional approvals. BMS may be facing challenges at present, but its recent approvals and ability to develop new products should help it navigate these difficult times.

In the meantime, the stock appears to be significantly undervalued, with a forward P/E ratio of just 7. At current levels, Bristol Myers Squibb might be a steal. Down 17% so far this year, even with the headwinds it faces, the stock could deliver strong returns over the long run.