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. 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. 10 stocks we like better than Duke EnergyWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* David and Tom just revealed what they believe are the ten best stocks for investors to buy right now... and Duke Energy wasn't one of them! That's right -- they think these 10 stocks are even better buys. See the 10 stocks *Stock Advisor returns as of August 1, 2020 Dan Caplinger has no position in any of the stocks mentioned. The Motley Fool recommends Dominion Energy, Inc, Duke Energy, and NextEra Energy. The Motley Fool has a disclosure policy.Source