The Dow Jones industrial average was up 42.66 points, or 0.38 percent, to end at 11,242.59. The Standard & Poor's 500 Index was up 1.72 points, or 0.13 percent, to finish at 1,280.27. The Nasdaq Composite Index was up 13.53 points, or 0.65 percent, to close at 2,092.34.
Earlier in the day, Apple, the maker of the popular iPod digital music players, said it has teamed up with three major automakers to link the iPod with car stereos.
P&G shares climbed for the second day in a row, with Thursday's gains following a disappointing profit report from Unilever Plc/NV, which suggested P&G was growing at its Anglo-Dutch rival's expense. On Wednesday, P&G reported stronger-than-expected earnings.
Shares of retailers rallied as investors took the view that earnings across the group will come in on target despite generally lackluster July sales. That theory helped buoy shares of discounter Target Corp. and several apparel chains.
"For the majority of retail sales, the bar was set pretty low and most had been oversold, so many have rallied pretty hard from their opening lows," said Michael James, senior trader at regional investment bank Wedbush Morgan in Los Angeles.
Apple's stock gained 2.1 percent, or $1.43, to close at $69.59 on the Nasdaq.
Procter & Gamble rose 2 percent, or $1.16, to $59.45 on the New York Stock Exchange. Target's stock advanced 1.3 percent, or 61 cents, to $46.39.
An S&P index of retail stocks rose 2.2 percent.
Teen apparel retailer Abercrombie & Fitch Co. (ANF) climbed 6.2 percent, or $3.27, to $55.88 on the NYSE, while competitor American Eagle Outfitters Inc. (AEOS) advanced 8.1 percent, or $2.53, to $33.93 on Nasdaq. Shares of women's apparel retailer Chico's FAS Inc. jumped 8.5 percent, or $1.85, to $23.59 on the NYSE.
One major disappointment was weaker-than-expected sales from Starbucks Corp. (SBUX) Shares of the world's largest coffee-shop chain fell 8 percent, or $2.66, to $30.64, making it the biggest drag on the Nasdaq.
On Tuesday, the Fed will meet to decide on rates, and many investors hope it will pause in its two-year campaign of raising borrowing costs. U.S. interest-rate futures put the chances of a rate increase at about 40 percent.
Worse-than-expected data on the vast U.S. service sector raised hopes that the Fed may not need to tighten monetary policy, giving a boost to some rate-sensitive financial shares.
Brokerage Morgan Stanley rose 2.4 percent, or $1.57, to $67.80, while rival Lehman Brothers Brothers Holdings Inc. gained 3.1 percent, or $1.97, to $66.17.
The Institute for Supply Management, also known as the ISM, reported Thursday that its monthly nonmanufacturing index, which measures activity in the services sector of the U.S. economy, fell to 54.8 in July from 57.0 in June.
Shares of large industrial companies, sensitive to cycles in the economy, advanced, as investors bet a pause in rate hikes would keep the economy from slowing too dramatically.
Heavy-equipment maker Caterpillar Inc. (CAT) rose 2.8 percent and led the Dow higher. Caterpillar gained $1.98 to close at $72.73 on the NYSE. Shares of jetmaker and U.S. defense contractor Boeing Co. (BA) gained 1 percent, or 78 cents, to $79.40.
Trading was active on the NYSE, with about 1.81 billion shares changing hands, above last year's daily average of 1.61 billion, while on Nasdaq, about 1.85 billion shares traded, above last year's daily average of 1.80 billion.
Advancing stocks outnumbered declining ones by a ratio of about 3 to 2 on both the NYSE and the Nasdaq.