Major benchmarks continued to gain ground on Wednesday, and bullish investors appear to be getting even more excited about a larger swath of stocks. A rotation away from some of the hottest technology players helped boost the Dow Jones Industrial Average (DJINDICES:^DJI) to much greater gains than the Nasdaq Composite, and the S&P 500 (SNPINDEX:^GSPC) also weighed in with a solid performance. The latter two managed to close at new records.

Today's stock market

Index

Percentage Change

Point Change

Dow

+1.6%

+454

S&P 500

+1.5%

+54

Nasdaq Composite

+1.0%

+116

Data source: Yahoo! Finance.

Tech hasn't been the only sector of the market that has performed well lately, as consumer stocks have also played a key role in pushing indexes higher. Yet today, a surprise leader emerged. Utility stocks took the lead, with the Utilities Select Sector SPDR (NYSEMKT:XLU) topping its peers as the best gainer on the day.

A boost for a hard-hit sector

The rise in utility stocks comes after a tough period for the sector. After having bounced sharply from March lows, shares of utilities largely plateaued during the spring months. The ETF closed Tuesday at its lowest level in six weeks.

Power lines and towers at sunset or sunrise.

Image source: Getty Images.

Yet the gains for utilities came across the board on Wednesday. NextEra Energy (NYSE:NEE) and Exelon had some of the largest increases, but other top companies like Duke Energy (NYSE:DUK), Southern, and Dominion Energy were also up nicely as well.

Picking winners and losers

Although many utility companies have a lot in common, they don't always trade in lockstep. Different characteristics can make some utilities behave unlike others.

For instance, even during a slow period, NextEra has been on the rise lately. NextEra has a combination of assets that includes the largest traditional regulated electric utility business in Florida. However, it also owns huge arrays of solar and wind power assets, giving it an attractive renewable power business that has helped foster greater growth than most of its utility peers lately. At a time when many utilities have had to retrench, NextEra has kept investing in new projects.

Other utility stocks, however, remain largely defensive plays that tend to gain ground only when there's doubt about the sustainability of growth elsewhere across the economy. Duke Energy, for example, is one of the largest utilities in the U.S., with a huge regulated business spanning six key states in the Southeast. It has few big growth prospects, but its key revenue source is largely protected by a regulatory structure that ensures predictable returns on investment.

Will utilities keep rising?

As the overall stock market keeps going up, conservative investors might start getting more nervous about the sustainability of the gains they're enjoying. In that case, more defensive stocks like utilities could be attractive. They're also good dividend payers, making them valuable for those needing income from their portfolios now.

Utility investors shouldn't expect huge gains from their investments, however. For those seeking more growth, utility stocks don't have the same potential as companies in traditional fast-expanding industries like tech.

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.