NEW YORK—Hershey said its net income rose 5.5 percent in the fourth quarter, as sales of its Kit Kats, Reese's and other candies boosted revenue.

The company, based in Hershey, Pa., noted that it gained market share across categories during the quarter and raised its outlook for the year. Its shares briefly hit a new high.

In the year ahead, the company plans to step up investments in five brands—Hershey's, Reese's, Hershey's Kisses, Jolly Ranchers and Ice Breakers—that it believes "can transcend borders around the world."

For the October to December period, The Hershey Co. said it earned $149.9 million, or 66 cents per share. That's up from $142.1 million, or 62 cents per share, in the year ago period.

Excluding one-time items, the company earned 74 cents per share. By that measure, analysts on average expected earnings of 76 cents per share, according to FactSet.

Sales rose 12 percent to $1.75 billion from $1.56 billion a year earlier. Analysts expected $1.7 billion.

During the fourth quarter, the company said its adjusted gross margin improved on higher pricing and cost savings, although that was partially offset by higher costs for ingredients. Selling, marketing and administrative expenses, which includes advertising, rose 19 percent, reflecting increased investments overseas.

For 2012, Hershey earned $660.9 million, or $2.89 per share, up from $628.9 million, or $2.74 per share, in 2011. Revenue rose to $6.64 billion from $6.08 billion.

Hershey expects earnings to increase by 10 percent to 12 percent to $3.56 to $3.63 per share, above the 8 percent to 10 percent increase previously forecast. Analysts expect $3.60 per share on average.

It reaffirmed it expects total sales for the year to increase by 5 percent to 7 percent, driven primarily by a boost in volume.

Its shares rose 87 cents to $79.16 in morning trading after rising as high as $79.50 earlier in the session. That was its highest level ever, according to FactSet.