Stocks rose in light volume on Friday, buoyed by rising energy and basic materials shares, as the S&P 500 kept showing resilience even as it posted its second negative week so far this year.

The benchmark S&P 500 slipped 0.5 percent for the week. In an indication of the rally's strength and consistency, that was the S&P's worst performance since the last week of December. In its only other down week in 2012, the index dipped 0.17 percent.

The market edged lower in early trading, but downward momentum faded despite widespread expectations for a correction after a rally that set the S&P 500 up for its best back-to-back quarters since 2009.

The S&P 500 is still near its highest since May 2008.

There's many people thinking a correction is coming, but some technical indicators suggest more a pause than a correction at this point, said Todd Salamone, director of research at Schaeffer's Investment Research in Cincinnati.

The S&P 500 found strong support at its 14-day moving average, near 1,386, from where it bounced back to post gains for the day. Holding that level speaks to the power of the uptrend, it proves the momentum is still in place, Salamone said.

The S&P energy sector index <.GSPE> and the S&P basic materials sector index <.GSPM>, both up almost 1 percent, led gains after both sectors weighed the most during Thursday's decline.

Analysts see sector rotation as an indication of investors' reluctance to abandon stocks and a sign of potential strength for the market.

The Dow Jones industrial average <.DJI> gained 34.59 points, or 0.27 percent, to 13,080.73 at the close. The S&P 500 Index <.INX> rose 4.33 points, or 0.31 percent, to 1,397.11. The Nasdaq Composite <.IXIC> added 4.60 points, or 0.15 percent, to 3,067.92.

For the week, the Dow fell 1.2 percent and the S&P 500 lost 0.5 percent, while the Nasdaq added 0.4 percent. It was the Nasdaq's sixth-straight week of gains, following a dip of 0.06 percent early last month.

About 5.9 billion shares traded on the New York Stock Exchange, NYSE Amex and Nasdaq, the second-lowest volume for any day this year. The daily volume average so far in 2012 is 6.84 billion.

U.S. crude oil futures prices rose 1.4 percent to settle at $106.87 a barrel on estimates that Iranian oil exports fell significantly this month.

Chevron Corp rose 1 percent to $106.36.

A catalyst for Friday's rebound in basic resources stocks came from the world's top copper producer, Chile's Codelco, which reported a surge in profits and an increase in production.

Copper prices rose 1 percent.

New U.S. single-family home sales fell 1.6 percent in February while prices jumped to their highest level in eight months, according to a government report on Friday that was the latest to paint a mixed picture of the housing market.

The PHLX housing sector index <.HGX> lost 0.6 percent after falling nearly 3 percent earlier in the session.

KB Home tumbled 8.5 percent to $10.29 after the fifth-largest U.S. homebuilder posted a wider first-quarter loss and said orders for new homes declined.

A series of blunders hit the market debut of BATS Global Markets Exchange , causing its own shares to erroneously trade for less than a penny. The company said it would withdraw its IPO.

The problems also fouled a trade in shares of Apple Inc , and caused a temporary halt in its shares. The erroneous Apple trade was later canceled.

In Nasdaq trading, Apple lost 0.5 percent to $596.05.

Online games maker Zynga Inc fell 2.6 percent to $13.40 after it said shareholders will sell about 43 million shares in a secondary offering.

Job search website Monster Worldwide Inc is open to selling all or part of itself and expects to have data ready for potential buyers soon, its chief executive said in an interview. Monster's stock jumped 7.7 percent to $10.22.

Advancing issues outnumbered declining ones on the NYSE by a ratio of about 12 to 5, while on the Nasdaq, about two issues rose for every one that fell.

(Reporting by Rodrigo Campos; Editing by Jan Paschal)