Solar stocks have a day in the sun, or is it just a flare?

Yuriko Nakao | Bloomberg | Getty Images

Solar stocks were long derided as underperforming dogs, sucker bait for idealists. But now several are having their day, and Exxon Mobil is the one in the doghouse.

Two top solar exchange-traded funds, Guggenheim Solar and Market Vectors Solar, are up 82 percent and 51 percent year-to-date, respectively. SunPower, one of the largest solar companies, is up 308 percent, and Canadian Solar is up 287 percent. It can be a volatile space, though, with both of those stocks more than 15 percent off one-month peaks.

(Read more: Exxon's trip from world's most valuable to dog of the Dow)

But is this just another swing in the solar pendulum, or has something fundamentally changed in the sector? And what sets these industry leaders apart?

Turns out not all solar panels are alike.

"This is not a homogeneous market," said Dave Waserstein, partner and director of investments at clean technology venture capital firm 12BF Global Ventures.

"Increasingly, companies are differentiating by quality," Waserstein said. "You see that as valuations for U.S. manufacturers tend to be higher than those for Chinese." Also among Chinese companies, such as Suntech and Yingli, the market is taking clear sides. Shares of Suntech are down 24 percent, while Yingli has gained 78 percent this year.

Waserstein said that as recently as seven years ago "you had big names that didn't know what they were doing, and they've exited the market."

Waserstein also forecasts market consolidation, perhaps among Asian companies, which will help close the supply-demand imbalance. Solar capacity exceeded market appetite by 50 percent last year.

Jonathan Robinson, research manager at Frost & Sullivan, told CNBC's "Worldwide Exchange" on Friday that while overcapacity is tough on profits, the resulting lower prices are good for the sector.

The Department of Energy reportedly expects prices to fall 75 percent between 2010 and 2020. That could bring the industry to what it calls grid parity—price competitiveness with fossil-fuel-based utilities.

Brian Carey, U.S. Cleantech advisory leader with PricewaterhouseCoopers, says the key for companies is the ability to keep up with the market's realignment.

(Read more: More cowbell—or less? Climate strategies point opposite ways)

"Europe drove a lot of the growth a couple years ago, but that resulted in overinvestment and now growth is slow there," Carey said. "The growth potential appears to be in China and the U.S.," he said, adding that Japan, the Middle East and Latin America also show strong potential.

Intense competition has forced reductions in manufacturing costs, and that is ultimately good for the industry, Carey said. "Panel [makers] come to us to help them optimize production. I'm optimistic prices will continue to decline."

As manufacturing cost reductions reach their limits, the focus will shift to "soft costs": installation, permitting, marketing and financing. Such costs in the U.S. are 40 percent more than in Germany, Waserstein said, because companies there are better at minimizing them.

(Read more: Can students make an impact with fossil fuel divestment drive?)

Tom Burton, founder of the energy and clean technology practice at the law firm Mintz Levin, likes panel maker First Solar for its competitive advantages.

"It's the gold standard—they've figured it out," he said, citing scalability, innovation, and vertical integration. Shares are up 26 percent this year, though 31 percent off a June peak.

A major driver of U.S. residential demand is the financing packages that make solar panel installation more feasible for homeowners, Burton said.

But Waserstein said that a lot of cost streamlining remains to be done.

Economically battered European countries aren't as well-positioned as they have been to support solar energy development and adoption. Meanwhile, China is showing a willingness to subsidize projects, which could help boost demand.

In the U.S., the Solar Investment Tax Credit—a 30 percent credit for residential and commercial solar systems—will run through 2016.

"The long-term prospects [for solar] are very strong," said Carey of PricewaterhouseCoopers, "and the overall trajectory is upward."

By CNBC's Matt Twomey. Follow him on Twitter @Matt_Twomey.