Shares of Hershey (HSY) - Get Report are rising by more than 3% Thursday, reaching a session high of $111.76, or just above its 20-day moving average. And there could be more sweet gains up ahead.

On Thursday, the global chocolate company reported second-quarter earnings results that beat estimates on both the top and bottom lines. The company's pricing advantage, which led to the earnings beat, underscores why Hershey stock has been one of my recommendations over the past six months.

Hershey has returned as much as 40%, rising from around $83 to around $118 on June 30. I wrote on its growth prospects on Jan. 25; a month later, at around $91 per share, I suggested its dividend deserved some patience.

Today the stock is trades around $110 after a stint near $118 after Mondelez's (MDLZ) - Get Report $23 billion merger bid, which Hershey rejected. The stock' value could drive Hershey stock higher from here.

Image placeholder title

Thanks to better-than-expected demand for products like Reese's Peanut Butter Cups and its Kisses candy, Hershey reported a revenue increase this year, beating estimates. That highlights the fact that the company's recent price increase has helped sales, not hurt them, as had been feared.

The company's improved pricing power would explain why Mondelez was willing to pay a premium for the company.

Hershey is now looking for ways to boost earnings even higher by strategic cost cuts. That justifies the expensive stock price. Although the forward price-to-earnings ratio of 25 is 8 points above the P/E of the average stock in the S&P 500 (SPX) index, Hershey's earnings are now expected to rise at a faster rate than revenue, both in fiscal 2016 and fiscal 2017.

From a technical perspective, Hershey stock has downside support at around $106, or 4% lower. Though the shares met resistance at around $117 per share (the red line) on the news of Mondelez's bid, Hershey stock could reclaim that level in the second half of the year, heading into the Halloween shopping season.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.