Hershey (HSY) stock is getting a boost after it reported preliminary second quarter results and said it expects to raise prices of wholesale products to offset higher commodity costs.

NEW YORK (TheStreet) -- Shares of Hershey Co. (HSY) are gaining 0.35% to $94.99 in after-hours trading on Tuesday as it reported preliminary second quarter results ending June 29, and said it expects net sales and adjusted earnings per share-diluted to be "relatively in line" with its forecast.

Preliminary adjusted earnings per diluted share for the second quarter are projected to be in the range of 75 cents to 77 cents.

Also, Hershey said it will increase wholesale prices across the majority of its portfolio by approximately 8% to help offset significant increases in Hershey's input costs, including raw materials, packaging, fuel, utilities and transportation, which the company expects to incur in the future.

Separately, TheStreet Ratings team rates HERSHEY CO as a Buy with a ratings score of A-. TheStreet Ratings Team has this to say about their recommendation:

"We rate HERSHEY CO (HSY) a BUY. This is based on the convergence of positive investment measures, which should help this stock outperform the majority of stocks that we rate. The company's strengths can be seen in multiple areas, such as its revenue growth, expanding profit margins, growth in earnings per share, increase in net income and notable return on equity. We feel these strengths outweigh the fact that the company shows weak operating cash flow."