Internet users and investors were heartened last week when Yahoo (Nasdaq: YHOO), elected Marissa Mayer, 37, as its third new CEO in less than a year.

The alumna of Google (Nasdaq: GOOG), the No. 1 search engine, who earned computer sciences degrees from Stanford, was hailed as the right person to revive the fortunes of the Sunnyvale, Calif., search and media company. She'll get as much as $100 million if she succeeds in the next five years.

Yahoo shares gained about 1.4 percent for the week, closing Friday at $15.91.

Some credit for the Mayer hire is due to Third Point Capital, a New York hedge fund headed by Daniel Loeb, a Yahoo fan who started buying into the company last September when CEO Carol Bartz was fired.

Now with about a 5.8 percent stake, Loeb is a Yahoo director, along with two of his confederates. He helped select Mayer as the new boss.

For months, Loeb sent open letters to Yahoo's directors decrying mismanagement of its assets, which he wrote were greatly undervalued. Despite being No. 3 in search, where its technical partner, Microsoft (Nasdaq: MSFT), is No. 2, Yahoo News, Yahoo Finance and Yahoo Sports are all No. 1 in their sectors, Nielsen estimates.

Loeb and Third Point investors ought to be pleased: since September, the value of their shares has gained 23 percent. Assuming the company recoups some of the estimated $40 billion value of investments in Yahoo Japan (Tokyo: 4689) and China's Alibaba Group, they could gain much more.

Before Bartz's day, activist investor Carl Icahn made a play for Yahoo and won a board seat in 2008, leaving when Bartz was elected. In 2007, he started buying into Motorola, ultimately forcing the company to get new management and split in half.

Last August, Google agreed to acquire the consumer business, Motorola Mobility Holdings, for $12.5 billion. In February, the enterprise and networking unit, Motorola Solutions (Nasdaq: MSI) agreed to repurchase nearly $1.2 billion worth of stock from Icahn. Icahn is no longer a major shareholder.

Icahn did well with Motorola. But not all hedge fund managers share the same fate. Unlike the venture capitalists, such as New Enterprise Associates or Kleiner Perkins Caufield & Byers, which seed companies in infancy and reap billions when they turn into Yahoos, there's a higher threshold.

Some have been huge losers. One is the private equity unit of KKR & Co. (NYSE: KKR), the vehicle of private equity pioneers and cousins Henry R. Kravis and George Roberts. The unit bought $700 million in notes from Sun Microsystems as the former high-flying server maker and Java developer was foundering in 2007.

By the time Oracle (Nasdaq: ORCL), the No. 1 database developer, bought a much smaller Sun in early 2010, the stake had been halved. KKR recouped that only because of a change in corporate ownership.

Then the KKR unit bought into ailing Eastman Kodak (Pink: EKDKQ) in 2009 to help finance its push into the consumer printers sector against Hewlett-Packard Co. (NYSE: HPQ). It invested $300 million in notes and bought warrants valued at $220 million.

Kodak filed for bankruptcy on Jan. 19.

There are others: Starboard Value LP, another New York fund, bought a 5.3 stake in AOL (NYSE: AOL) earlier this year, believing it was mismanaged. In June, it lost a proxy fight, but not before CEO Tim Armstrong sold $1.06 billion worth of patents to Microsoft and took other steps to show he was listening.

Shares of AOL have gained 84 percent this year. Starboard is no longer a shareholder but made good money on its investment.

Last year Ralph Whitworth of Relational Advisors, who learned from the wily T. Boone Pickens about value investing, acquired 17.5 million shares in HP when it was foundering and on the verge of firing CEO Leo Apotheker. Last November, he was elected an HP director.

In order to profit, he'll have to be patient: HP shares have lost nearly 50 percent of their value since Whitworth bought in. They closed Friday at $18.60.