The bond market remained under pressure, sending yields higher, following an improvement in the April trade deficit. Still, the yield of the benchmark 10-year Treasury bond backed off an overnight high of 5.25%, helping to take some pressure off of stocks.
The Dow Jones Industrial Average gained 26 points to 13,293, as 21 of its 30 stocks advanced.
Among blue chips, McDonald's Corp. led the gains, rising 2.35% after saying global same-restaurant sales rose 8.7% in May.
The S&P 500 index advanced 3.1 points to 1,493, while the Nasdaq Composite gained 5.9 points to 2,547.
Tech shares receive a lift from the chip sector. National Semiconductor jumped 9.7% after the company posted a smaller-than-expected drop in profit and said it was buying back $2 billion worth of shares. UBS upgraded the stock to buy from neutral.
After dropping nearly 200 points on Thursday, the Dow industrials' losses amounted to 410 points over the past three sessions.
"The major market averages have now pulled back about 3% and are entering that target range for a typical summertime pullback of between 3% and 5%," said Marc Pado, market strategist at Cantor Fitzgerald.
"Obviously, the rocketing bond yields are disconcerting, but we are only now reaching technical support," he said. "It is possible that, once we digest the global market reaction to our selloff, we could see an attempt at a little Friday bounce."
Early Friday, the benchmark 10-year Treasury bond was down 5/32 at 94 31/32, yielding 5.15%. It earlier rose to a high of 5.25%.
Bond yields rose again after news that the U.S. trade deficit narrowed by 6.2% in April to $58.5 billion. This is the largest improvement in the trade gap since last October. The trade deficit was below the consensus forecast of Wall Street economists of a deficit of $63.5 billion.
The improvement in the deficit should boost second quarter gross domestic product, although there remains two months of trade data to assess for the second quarter.
The dollar rose sharply against the euro, with one euro fetching $1.3353, and also rose 0.5% at 121.62 yen.
Crude oil futures dropped 70 cents to $66.23 a barrel. Gold futures dropped $5.80 to $659.40 an ounce.
By Nick Godt