The past three weeks have been relatively lousy ones for the market. The S&P 500 (^GSPC -1.01%) is down nearly 9% from its August peak, and with another round of interest rate hikes likely looming, the index could lose even more ground in the foreseeable future.

Not every name has been swept out with the bearish tide. In fact, a handful of names have been rallying so well they're now out of reach for interested buyers. If these three stocks do take a short-term dip, be sure to use that pullback as a buying opportunity. The undertows driving these gains may not keep that window of opportunity open for very long.

1. First Solar

It's been largely overlooked thanks to noisier news, but the solar power industry is catching an incredible tailwind. Soaring energy commodity costs have pushed solar power's costs closer to price parity with many traditional sources of power generation, and there's no denying the White House supports this segment of the green energy revolution here and abroad; executive action taken by President Joe Biden in June encourages more domestic production of solar panels. Then, as called for within the Inflation Reduction Act passed last month, homeowners can receive federal tax credits for installing new solar power systems at their homes. These are the key reasons shares of solar panel manufacturer First Solar (FSLR -2.29%) are now up more than 100% from their June lows.

The bullish underpinnings of this legislation and executive action are hardly short-term. Indeed, after a bit of an installation slowdown over the course of the past few quarters, the United States' Energy Information Administration forecasts that solar power's share of the country's total power production will swell from 5% this year to 14% by 2035. That's huge. It's so huge, in fact, that First Solar announced late last month it's investing as much as $1.2 billion in a new solar panel production facility that will increase its production capacity on the order of 50%.

The market arguably overreacted to these developments in the way it pushed the stock higher so quickly, but it's not as if there's not a massive growth opportunity ahead.

2. McKesson

Healthcare stocks in general -- and medical distributors in particular -- haven't been immune to this year's marketwide weakness. One of these stocks is defying the headwind. That's McKesson (MCK 0.94%). It's up nearly 50% since the end of last year and higher by nearly 80% for the past 12 months after reaching another record high in August.

Credit the nature of the business, mostly. McKesson delivers everything from prescription pharmaceuticals to clinical consumables like bandages, diagnostic kits, and surgical supplies. These are in demand regardless of the economic environment, and most hospitals are glad to let one single distributor meet as many of their needs as possible. McKesson isn't just a healthcare goods supplier. It also offers specialized services such as pharmacy management and support of specialty practices. It's even got something for pharmaceutical developers, which have to handle research and development of new drugs very, very carefully.

This high degree of diversity is one of the reasons the company has only failed to grow its top line in one quarter since 2014, and that one time was the second quarter of 2020 when the COVID-19 pandemic began to spread across the United States. It's not a high-growth business, but it's a business that's built like a tank. Investors have been seeking out such businesses this year -- clearly.

The stock's currently priced at right around 15 times its forward-looking, per-share earnings, versus a historical norm closer to (or even less than) 10 and rarely higher than 12. This suggests a corrective move of as much as 30% could be in the cards. Just don't get too thrifty if you're holding out for a pullback.

3. Constellation Energy

Finally, add Constellation Energy (CEG 1.35%) to your list of stocks that are a bit too expensive to step into right now but worth buying after any healthy dip.

It's classified as a traditional utility name, but that's not exactly what Constellation Energy does. In markets where it operates, the company can deliver electricity to a specific home or business, serving as a competing second choice of provider that most consumers and companies in the U.S. don't have. It's also the United States' top wholesale producer of carbon-free energy, with its fleet of nuclear, wind, solar, and hydro-power facilities generating 10% of the United States' carbon-free electricity. As the green-energy movement marches forward, the fact that 90% of the company's power output doesn't put any carbon back into the environment becomes an increasingly big deal.

Mostly though, investors will want to dig in after any meaningful pullback simply because this is a company with a bright long-term future.

Yes, last quarter's top line slumped a bit, as will this year's and next year's. That's intentional, however, resulting from the planned shutdown of some of its nuclear power plants. It's still on pace to generate a profit of $2.33 per share in 2022 on the way to $4.58 per share next year thanks to an ongoing shift away from its legacy facilities to newer and more cost-effective ones. As the company noted within its Q2 report, the Inflation Reduction Act "provides a nine-year production tax credit to support carbon-free nuclear energy resources in recognition of their critical role in addressing the climate crisis." The statement further explains the IRA "creates a tax credit for the production of clean hydrogen, which can be made with nuclear and other carbon-free energy resources."

In this vein, Constellation Energy signed a handful of new wholesale and corporate service deals during the second quarter, including one to provide power for Bank of America and another to purchase 600,000-megawatt hours of electricity from Doral Renewables' Mammoth Solar project in Indiana.