The S&P 500's bull market is nearly three years old. This year, the stock-market rally has broadened, with four sectors outperforming the full index.