(Starbucks background and insight added.) Starbucks ( SBUX) posted profit in the third quarter after a loss last year, sending shares in the company rallying in the after-market.

During the quarter, the coffee retailer earned $151.5 million, or 20 cents a share, compared with a loss of $6.7 million, or 1 cents, in the year-ago period. Analysts expected earnings of 19 cents a share.

Results were boosted by cost-saving initiatives, including store closures and job cuts, which amounted to $175 million in the quarter.

The company plans to cut $550 million in annual costs, up from its previous target of $500 million.

Revenues slipped 5.5% to $2.4 billion from $2.57 billion, while same-store sales fell 5%. This compares to an 8% decline in comparable sales last year.

Looking ahead, Starbucks expects full-year earnings in the range of 44 cents to 45 cents a share.

Last month the company rolled out new food items that it claims has more "real" ingredients.

As Starbucks dukes it out with McDonald's ( MCD) and Dunkin' Dounuts over who really has the best cup of Joe, it is clear the company can't compete on price. Maybe if it shifts its focus to food, so the thinking appears to be, it can come out on top.

Shares of the company jumped 7% to $15.94 in after-market trading.
Copyright 2009 TheStreet.com Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.