HERSHEY, PA. — The Hershey Co. is facing heightened competition in the candy aisle.

The maker of Reese’s and Twizzlers lost market share in the recent quarter due in part to “increased levels of competitive innovation within both the chocolate and sweets categories,” said Michele G. Buck, president and chief executive officer.

“I think many folks have been focused — certainly we’ve been focused — a lot on execution and meeting demand for the past few years and focused on the core with innovation not playing as big of a role,” Ms. Buck said during a July 27 earnings call. “And I think now we’re just seeing competitors in the marketplace start to dial up the innovation more back to historic levels. And as we go forward, that’s certainly an area that we’re going to be focused on as we are continuing to increase capacity at the same time.”

Net income for the second quarter ended July 2 increased 29% to $406.96 million, equal to $2.03 per share on the common stock, up from $315.56 million, or $1.57 per share, in the prior-year period. Adjusted net income was $412.53 million, up 11% from $372.42 million.

Net sales increased 5% to $2.49 billion from $2.37 billion the year before.

“We delivered another solid quarter across our three segments with price realization offsetting inflation, productivity enabling margin expansion, and flat volumes excluding the impact of anticipated inventory headwinds,” said Steven E. Voskuil, chief financial officer, in prepared remarks. “This performance and good visibility into second half programming, pricing, and inflation, gives us confidence to raise our full-year adjusted earnings outlook despite rising costs in several key commodities.”

For the full year, management continues to expect net sales growth of 8%, “as incremental pricing is expected to be largely offset by comparable volume declines as elasticities return to historical levels,” Mr. Voskuil said.

The company now expects reported earnings-per-share growth of 13% to 15%, down from the prior guidance of 15%, and adjusted earnings-per-share growth of 11% to 12%, up from the previous guidance of 11%.

During the second quarter, the North America Confectionery segment had income of $657.18 million, up 6.2% from $618.86 million, as sales growth and gross margin expansion more than offset increased investments in brand marketing and capabilities.

Segment net sales were up 4.4% at $1.99 billion from $1.91 billion the year before. Organic, constant currency net sales climbed 4.8%, as price increases more than offset expected volume declines related to inventory timing and price elasticity.

“Price elasticity increased slightly versus the first quarter, in line with expectations, and remains well ahead of historical levels,” Ms. Buck said. “We expect elasticities to gradually increase as we progress through the year and enter 2024.”

The company’s candy, mint and gum market share declined approximately 80 basis points due to unfavorable category mix and competitive activity.

“With our increased chocolate capacity this year, and additional co-manufacturing secured within sweets for next year, we can now more aggressively pursue growth opportunities to improve our market share performance,” Ms. Buck said. “This will include greater levels of innovation, distribution expansion, and targeted increases in promotional activity in 2024 to return merchandising share to historical levels.

“We will begin to see some impact from these investments in the second half of 2023, with Halloween retail sales planned to increase double digits versus prior year as we are able to better meet customer demand.”

In the North America Salty Snacks segment, income of $43.75 million was up 17% from $37.43 million. Segment net sales increased 6.3% to $272.37 million from $256.3 million, benefiting from price increases that offset volume declines as a result of a shift in the timing or promotional activity as well as go-to-market execution challenges, Ms. Buck said.

Hershey gained market share in the ready-to-eat popcorn and pretzel categories, led by Skinny Pop and Dot’s, which have “healthy” household penetration despite increased private label activity, Ms. Buck said.

International segment income increased 34% to $41.1 million from $30.7 million on sales of $224.84 million, up 8.5% from $207.18 million. Organic, constant currency net sales grew 6.2% driven by balanced price and volume growth.

“Category trends across markets remain strong, and Hershey continues to gain share by increasing household penetration through innovation and distribution gains,” Ms. Buck said. “Margins continue to be a bright spot, with segment operating profit margin up 350 basis points in the quarter.”

The company is gearing up for a “very strong Halloween,” Ms. Buck said, noting seasonal traditions are important to consumers during difficult economic times.

“We know that customers are planning big displays, and we are certainly participating in that and as well, have strong marketing support to consumers planned as well,” she said. “So we have certainly taken an approach of leaning into Halloween, we feel good that there will be plenty of candy out there.”

For the six months ended July 2, Hershey’s net income was $994.17 million, or $4.96 per share, up 17% from $849.03 million, or $4.24 per share, in the comparable period. Net sales increased 12% to $2.51 billion from $2.25 billion.

Shares of Hershey trading on the New York Stock Exchange closed on July 27 at $233.56, down 2.9% from the previous close of $240.44.