When interest rates are rising, sectors like financials and energy tend to beat the rest of the stock market, historical analysis shows.

CNBC used analytics tool Kensho to determine the best-performing sectors in the S&P 500 when the 10-year Treasury note yield increased 25 basis points or more over a span of 30 days. There have been 18 instances of such a move happening since 2008.

The 10-year yield surged about 18 basis points last week alone to 3.23 percent and investors are scrambling to play the impact as these higher rates ripple through the economy. The U.S. Treasury market is closed Monday in honor of the Columbus Day holiday.

The Financial Select Sector SPDR fund (XLF) returned an average of 3.1 percent over a one-month span when rates were rising sharply, according to Kensho. The Energy Selector Sector SPDR fund (XLE) averaged a gain of 2.8 percent in such instances.

Banks turn a profit by charging borrowers higher, longer-term interest rates compared with the lower, short-term interest rates they dole out to savers. Bank of America is up 7.8 percent in the last three months; J.P. Morgan Chase is up 10.1 percent; and Citigroup is up 7.8 percent. The Financial Select Sector ETF is up 5 percent over the period.

WTI crude futures, meanwhile, closed up 1.5 percent for the week last Friday, their fourth straight positive week for the first time since January.

Other winning sectors when rates rise include consumer discretionary and technology stocks, which return 2.3 percent and 2 percent, respectively, in such instances.

Recent economic data — such as historically low unemployment and expanding corporate profits — have helped buoy interest rates in the past few weeks.