Costs during the quarter rose to $1bn (€0.7bn compared to $870m (€630m) during the same quarter in 2006, the company said in its latest financial report.
"Higher dairy prices and a slower than expected improvement in the US business adversely impacted results for the second quarter," Richard Lenny, Hershey's chairman, said in the report.
Net sales remained the same for the period at $1.05bn, however greater costs meant profit was down.
The company said investment behind Reese's, Hershey's and Kisses delivered a 4 per cent gain in sales behind these brands, however this was offset by lower sales of some other brands, leaving retail sales down 0.4 per cent for the quarter.
"Hershey's results during the first half did not meet expectations. Focused investment behind our core brands has proven to be beneficial," Lenny said. "However, new product innovation must become more sustainable."
This comes the same week as the company announced the completion of its partnership with Barry Callebaut, to receive 80,000 tonnes of liquid chocolate a year in the US.
The company also said its joint venture in India as the Godrej Hershey Foods and Beverages Company is up and running, and production with Lotte Confectionery has begun in China, as part of its strategy to move into emerging markets.
Following higher growth within its retail sales of dark and premium chocolate, the company said it would focus on this area to help improve sales, with new products and product development.
However, it said construction of the new factory in Mexico is underway, with production expected to begin by mid-2008. This factory will supply Hershey with liquid chocolate.
The report said the company looks to "invest accordingly" throughout the second half of the year, with new products such as Reese's Whipps and developing products within the key global markets.
However, it expects the higher dairy costs to continue to put pressure on its margins, resulting in a decline in earnings.
"We are taking the appropriate steps to ensure that Hershey enters 2008 with a strong foundation both in the US and within key global markets that represent attractive long-term potential."
Net income was down to $97m in the six months up to 1 July, from $220m in the same six months in 2006. Net income for the second quarter was $3.5m, compared to $98m for the same quarter in 2006.