It's October, and that means that like everyone else, investors are a little more wary of things that could spook their portfolios. Lately, market participants have counted on lawmakers in Congress to find a way to work with the White House and come up with a plan to provide more economic stimulus to make ends meet. Today's suggestion that there might not be a near-term solution to the economic woes of millions of Americans led to a sell-off. By the end of the session, the Dow Jones Industrials (DJINDICES:^DJI), S&P 500 (SNPINDEX:^GSPC), and Nasdaq Composite (NASDAQINDEX:^IXIC) had all suffered significant losses.

Today's stock market

Index

Percentage Change

Point Change

Dow

(1.44%)

(411)

S&P 500

(1.63%)

(57)

Nasdaq Composite

(1.65%)

(193)

Data source: Yahoo! Finance.

Yet there was an interesting group of stocks that managed to gain ground even on a dark day. Shares of solar energy companies were strong performers, with many different facets of the industry seeming to attract investors to take a closer look. That's somewhat surprising given the state of the energy market more broadly, but it points to a trend in solar that could spell more gains for these stocks.

Sun rising over mountain, with solar panels in foreground.

Image source: Getty Images.

The sun is shining on solar stocks

There were several bright spots in the solar industry on a dreary day for the broader market. Here are just a few:

  • Solar power giant SunPower (NASDAQ:SPWR) saw its stock rise another 3%, adding to recent gains.
  • Some solar panel manufacturers saw even larger moves higher. JinkoSolar (NYSE:JKS) picked up more than 8% Monday, while Canadian Solar (NASDAQ:CSIQ) climbed nearly 4%.
  • On the equipment side of the business, microinverter specialist Enphase Energy (NASDAQ:ENPH) pushed higher by 3.5%. That marked another all-time high for Enphase.

Fundamentally, the moves were strange. Solar energy tends to do best when prices of fossil-fuel energy sources are high, because it then makes more economic sense to substitute in renewable energy sources. That's certainly not the case right now, with crude oil still stuck around $40 per barrel.

Going beyond price

However, the solar market hasn't behaved with perfect alignment to economic conditions lately. Solar and other renewable energy sources, including wind, appear poised to become the most prevalent source of electrical generation worldwide by the end of the 2020s, according to the International Energy Agency.

In the U.S., there are still significant incentives supporting solar energy. Many states have programs to pay additional money to residential solar power system owners, requiring utilities to account for a certain portion of their overall production through renewable energy credits. Even when fuel prices are low, that can be enough to make things more economical.

Moreover, in other countries around the world, more stringent regulations make solar power even more attractive. In some areas, fossil fuel-burning generation simply isn't an option.

In recent years, we've seen not only rising demand for electricity, but also the consequences of an outdated energy infrastructure system. Solar advocates see the potential for a game-changing shift in electrical distribution to focus more on local generation from solar. If that happens, then the gains that solar stocks like SunPower and Enphase saw today could be just the beginning.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.