NEW YORK - Investors took a chance on some beaten-down shares Thursday, lifting U.S. markets for the first time in four days.

The gain was modest, but broad, with eight of the 10 industry sectors of the Standard & Poor's 500 index ending higher. Drillers and other energy companies, down sharply in previous days, climbed 0.6 percent, far more than the rest of the market. Among individual stocks, Chevron rose nearly 2 percent.

Some suppliers of raw materials posted gains, too. The aluminum giant Alcoa and the mine company Freeport-McMoRan each rose 5 percent.

The Dow Jones industrial average climbed 82.45 points, or 0.47 percent, to close at 17,574.75. The Nasdaq composite increased 22.31 points, or 0.44 percent, to 5,045.17. The S&P 500 index rose 4.61 points, or 0.23 percent, to 2,052.23.

The climb came despite a continuing slump in commodities prices that has been rattling markets all year. Benchmark U.S. crude oil fell to another seven-year low.

The natural gas and coal producer Consol Energy jumped 10 percent. It is still the biggest loser in the S&P 500 this year, down 78 percent.

In economic news, applications for unemployment benefits rose last week, but the number of Americans seeking aid remains close to historic lows. The report comes a week before the Federal Reserve is expected to raise interest rates for the first time in nine years, a move that would signal that the central bank is confident the economy is strong enough to withstand higher borrowing costs.

"There is a fear over the market. China is slowing, emerging markets are slowing," said James Dunigan, chief investment strategist at PNC Wealth Management. "But if the Fed can say, 'We're comfortable with U.S. employment and economic growth,' that will be a positive."

The price of crude oil fell 40 cents, or 1 percent, to $36.76 a barrel in New York, its lowest level since early 2009. Brent crude, the international benchmark, fell 38 cents, or 0.9 percent, to $39.73 a barrel in London.

The upside to cheap oil is that consumers save money at the pump, giving them more money to spend elsewhere. But that boost has not helped much yet.

"You just don't have anything to show in retail sales or consumer spending," said James Paulsen, chief investment strategist at Wells Capital Management. "Where is the stimulus from lower oil?"

In other fuel-futures trading, wholesale gasoline fell 4.9 cents to close at $1.28 a gallon, heating oil lost 1.4 cents to $1.225 a gallon, and natural gas fell 4.7 cents to $2.105 per 1,000 cubic feet.

In metals trading, futures closed mostly lower. Gold edged down $4.50, to $1,072 an ounce; silver lost 8 cents, to $14.11 an ounce; and copper was up less than a penny, at $2.07 a pound.

U.S. government bond prices fell slightly. The yield on the 10-year Treasury note rose to 2.23 percent, from 2.21 percent late Wednesday. The dollar rose to 121.62 yen, from 121.19 yen. The euro fell to $1.0936, from $1.1028.