Higher earnings from energy and chemical companies nudged the stock market up Thursday.

The modest move extends a pattern seen this week: Even with plenty of earnings news from big companies, the broader market has shuffled between minor gains and minor losses.

advertisement | advertise on newsday

Cabot Oil & Gas and Range Resources corporations each reported revenue and earnings that trumped estimates, sending their shares up about 7 percent. Facebook soared 29.61 percent after reporting earnings late Wednesday that easily beat analysts' forecasts thanks to higher revenue from ads on mobile devices. Facebook's stock gained $7.85 to $34.36.

Nearly halfway through the second-quarter earnings season, the overall trend looks good, but not great, said Tyler Vernon, chief investment officer of Biltmore Capital in Princeton, N.J. "There have been some big disappointments . . . but we're seeing better and better numbers coming out."

The Standard & Poor's 500 index gained 0.26 percent to close at 1,690.25.

The Dow Jones industrial average rose 13.37 points to 15,555.61. The Dow was held back by The Home Depot and Caterpillar, which warned of sagging sales on Wednesday. The Nasdaq composite index gained 0.71 percent to 3,605.19. -- AP