U.S. stocks rose on Tuesday as natural resource shares gained from higher commodities while Kraft Foods Inc's offer for confectioner Cadbury raised hopes about more mergers and acquisitions.

Kraft, North America's biggest food company, said it was intent on pursuing Britain's Cadbury Plc , which rejected a $16.7 billion Kraft bid. Kraft shares slid 5 percent to $26.69 and helped cap gains on the Dow.

Energy shares led the S&P 500 higher as oil futures jumped 4.8 percent to top $71 a barrel, with a fall in the dollar making oil effectively cheaper for foreign buyers.

M&A activity may signal investors that some shares are considered inexpensive, analysts said. An uptick in activity would also show a corporate willingness to spend, possibly reflecting confidence in an economic recovery.

The Kraft bid comes after Walt Disney Co's deal last week to buy Marvel Entertainment Inc for $4 billion.

You're starting to see some merger news, which gives people the idea that things are functioning in the world, said Doug Roberts, chief investment strategist at Channel Capital Research.com in Shrewsbury, New Jersey. It's a sign that there's some liquidity and that people are willing to buy things.

The Dow Jones industrial average <.DJI> gained 22.14 points, or 0.23 percent, to 9,463.41. The Standard & Poor's 500 Index <.SPX> added 5.37 points, or 0.53 percent, to 1,021.77. The Nasdaq Composite Index <.IXIC> rose 7.96 points, or 0.39 percent, to 2,026.74.

Although Kraft stock fell, other food companies rose, including Hershey Co , which added 0.7 percent to $38.89. Some analysts pointed to the possibility of Hershey and Nestle making a joint bid for Cadbury.

In the oil sector, Chevron Corp rose 2.3 percent to $70.54 and provided the top boost to the Dow, while the S&P index of energy companies <.GSPE> was up 2.6 percent.

Freeport-McMoRan Copper & Gold Inc gained 2.8 percent to $67.85 as spot gold rose above $1,000 an ounce to its highest level since March 2008 on a wave of technical momentum and dollar weakness.

Health insurance stocks <.HMO> slid 1.4 percent before U.S. President Barack Obama's address to Congress on Wednesday. He is expected to outline his proposed revamp of the healthcare system.

The sector had actually begun to stabilize with the belief that there would be gridlock in Washington over the issue, said Tim Ghriskey, chief investment officer of Solaris Asset Management in Bedford Hills, New York. Clearly it is a sector that has some risk to it given potential legislation.

Shares of General Electric Co advanced 4.2 percent to $14.45 after J.P. Morgan Securities upgraded the stock, saying it was one of the last equities for which a little good news could still go a long way.

Shares of iPod maker Apple Inc rose 1.2 percent to $172.27 after Morgan Stanley raised its price target to $200 from $195. The Morgan Stanley also raised the U.S. systems and PC hardware sector to attractive from in line.

(Reporting by Chuck Mikolajczak; additional reporting Leah Schnurr; Editing by Kenneth Barry)