Yahoo Inc. shares rose 4 percent Friday amid speculation it will team up with Microsoft Corp. in an online search advertising partnership aimed at mounting a more serious challenge to Google Inc.

The Sunnyvale, Calif.-based company also got a slight boost after Google released its second-quarter earnings late Thursday. Google executives say larger advertisers have returned to the Internet after being absent earlier in the year, raising hopes that Yahoo's second-quarter results, due out Tuesday, might not be quite as dreary as some investors feared.

and Microsoft have been meeting in the this week and could sign a deal as early as next week, according to AllThingsD, a technology blog that cited unnamed people at both companies.

Yahoo and Microsoft declined to comment.

But Yahoo CEO Carol Bartz has publicly said she will join forces with Microsoft if the price is right and she is convinced her company will still have adequate access to search data.

That information about Web surfers is important to Yahoo because it still wants to track user preferences so it can figure out what kind of advertising is likely to generate revenue-generating clicks in its own marketing network.

The rivals have been discussing an alliance since 2006, but Yahoo's previous two CEOs - Terry Semel and - couldn't come to terms with the world's largest .

If the latest round of talks are fruitful, analysts believe Yahoo will be get a lump sum of cash and billions of dollars more in guaranteed payments spread over several years while reaping annual savings of at least $500 million from not having to run its own search engine.

The potential for a deal helped drive Yahoo shares up 65 cents to close at $16.84.

Shares in Redmond, Wash.-based fell 15 cents, or 0.6 percent, to close at $24.29, while Mountain View, Calif.-based Google lost $12.35, or $2.8 percent, to $430.25.

Yahoo's search engine currently holds a nearly 20 percent share of the U.S. search market, leaving it a distant second to Google's 65 percent, according to comScore Inc. Microsoft's search engine ranks third with an 8 percent share.

On Friday, Oppenheimer analyst Jason Helfstein said he's heartened by improved ad trends at Google. Although it's not clear the same would be true for Yahoo, Google's experience does give him greater confidence that Yahoo can exceed his revenue and profit estimates.

©2009 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.