Consumer companies rose as oil prices tumbled, alleviating fears about discretionary spending.

Royal Caribbean led cruise lines higher after the pleasure-shipping line posted earnings ahead of Wall Street expectations. JetBlue Airways posted a wider second-quarter loss due to higher fuel costs.

Consumer staples companies, considered less risky because of the evergreen nature of their businesses, were also strong. Coca-Cola shares rose after the iconic soda maker logged second quarter earnings growth, citing better concentrate sales, pricing and product mix.

Consumer confidence declined in July as consumers' assessment of current business and labor-market conditions softened for a third straight month, according to the latest survey from research firm The Conference Board said.

Write to Rob Curran at rob.curran@dowjones.com