U.S. stocks advanced for a second day, after analysts said chipmakers will benefit from rising global demand and energy shares are cheap relative to crude prices.

The S&P 500 added 14.91, or 1.1 percent, to 1,423.57. The Dow Jones Industrial Average increased 94.28, or 0.7 percent, to 12,992.66. The Nasdaq Composite Index gained 37.03, or 1.5 percent, to 2,533.73, as Yahoo! Inc. climbed 2.3 percent.

Exxon Mobil Corp. helped push the S&P 500 Energy Index to a record after UBS AG said the oil industry is ``notably inexpensive.'' Shares ended up $1.39, or 1.55 percent to $91.30.

Crude-oil futures fell after gaining as much as $2 a barrel, as a bigger-than-expected climb in U.S. natural gas supplies pushed prices for natural gas to their lower level in more than a week. Crude for June delivery shed 10 cents to close at $124.12 a barrel on the New York Mercantile Exchange.

Media giant CBS Corp. made a major push into the Internet world today, announcing that it was acquiring CNET Networks for about $1.8 billion, owner of numerous entertainment and information Web sites. CBS shares closed down 59 cents or 2.4 percent to $24.23 while CNET Networks surged $3.46 or 43.5 percent to $11.41.

Meanwhile, Comcast Corp. said that it reached an agreement to Plaxo Inc., which operates an online address book and a social network called Pulse and provided the basis for other popular social networking sites, including Facebook and Friendster. Shares gained 17 cents to $22.54.

J.C. Penney Co., the third-largest U.S. department-store chain, also contributed to the rally after reporting that its first-quarter profit fell by 50 percent on lower consumer spending and it forecast a similar profit drop for its current quarter. The shares climbed $2.07 to $46.32.