NEW YORK (

TheStreet

) -- Stocks gained for the third straight session Friday amid light trading volumes headed into the long holiday weekend. Materials, capital goods and financial sectors were among the biggest gainers.

The

Dow Jones Industrial Average

gained 39 points, or 0.3%, to finish at 12,441, just below a session high of 12,484. The

S&P 500

added 5 points, or 0.4%, to close at 1331, and the

Nasdaq Composite

rose 14 points, or 0.5%, to settle at 2797.

Despite the recent gains, stocks still finished the week lower with the Dow giving up 0.5%, the S&P 500 losing 0.1% and the Nasdaq dropping by 0.2%.

Bank of America

(BAC) - Get Report

,

Johnson & Johnson

(JNJ) - Get Report

and

Walt Disney

(DIS) - Get Report

led the the Dow higher on Friday while

McDonald's

(MCD) - Get Report

,

Intel

(INTC) - Get Report

and

Merck

(MRK) - Get Report

were among the biggest laggards.

Positive comments regarding the global economy from the Group of Eight summit in Deauville, France, offset some lackluster economic data. The euro rose 1% against the dollar, which was down 0.8%, according to the dollar index.

The FTSE in London rose 1%, and the DAX in Frankfurt advanced 0.7%. Japan's Nikkei slipped 0.4%, while Hong Kong's Hang Seng gained 1%.

The greenback's weakness lifted prices across the commodity sector. The July

crude oil contract added 36 cents, or 0.4%, to settle at $100.59 a barrel. Gold for August delivery gained $13.60, or 0.9%, to settle at $1,537.30 an ounce.

Earlier, the

National Association of Realtors said pending home sales plunged 11.6% in April, after gaining 5.1% in March. The market had only expected a decline of 1.4% in April, according to

Briefing.com

.

The University of Michigan upwardly revised its May consumer sentiment index reading to 74.3. Economists hadn't expected any revisions to the prior May index reading of 72.4, according to

Briefing.com

. In April, the consumer sentiment index came in at 69.8.

"The dollar trade has been very important recently, but at the end of the month, you also see managers trying to spruce up their portfolios in something called window dressing," said Quincy Krosby, a Prudential Financial market strategist.

Krosby said the availability of jobs played a strong role in Friday's better-than-expected May consumer sentiment reading.

"When all is said and done, the ability to get jobs and create jobs -- that will be what helps the economy gain momentum. So, today's strength could be partially from the consumer sentiment report but it's likely from the weaker dollar and end-of-the-month window dressing," she said.

Personal income and spending showed slower growth in April. The Commerce Department said personal income rose 0.4% in April, meeting expectations, after similar growth in March. Personal spending rose 0.4% higher in April, coming in slightly below expectations for a 0.5% uptick, after rising 0.5% in March.

"Real disposable income - after taxes and inflation - was unchanged in April and remains at the level posted in December 2010. So far this year, moderate job and income growth has been offset by the gasoline price led jump in consumer prices and by higher tax payments," said Stuart Hoffman, chief economist at PNC, in a recent note.

"Real consumer spending has grown modestly this year, but that modest growth has been financed by a decline in the personal savings rate," he said, adding that households are "on a short leash in terms of how far they can push their spending."

Shares of

Broadcom

(BRCM)

gained 5.4% to $36.52 after the

semiconductor company was added to the top picks list at FBR Capital Markets.

Shares of

Marvell Technology Group

(MRVL) - Get Report

jumped 11.2% to $16.17 after the

chipmaker issued a better-than-expected outlook for the second quarter during its conference call on Thursday.

Shares of

OmniVision Technologies

(OVTI)

plunged 8.9% to $33.18 after the

maker of image sensors for camera phones reported increases in fourth-quarter income and revenue and issued guidance that beat analysts' expectations on the high end.

Volumes were light, with less than 600 million shares changing hands on the New York Stock Exchange while 1.5 billion shares were traded on the Nasdaq.

The benchmark 10-year Treasury fell 4/32, lifting the yield to 3.072%.

.

-- Written by Melinda Peer and Shanthi Bharatwaj in New York

.

Disclosure: TheStreet's editorial policy prohibits staff editors and reporters from holding positions in any individual stocks.