Chocolatier Hershey is "falling out of the sweet spot" as people continue to shift toward healthier snacks, according to one Wall Street firm.

Morgan Stanley lowered its rating on Hershey shares to underweight, saying that lagging demand for confectionary foods – and snacks as a whole – could mean a sluggish year for the candy company.

"Hershey's historically advantaged growth profile has been challenged by slowing confectionery category growth, as consumer preferences shift toward other snacking categories," Morgan Stanley analyst Matthew Grainger wrote on Wednesday. "This slowdown has been most notable in the chocolate category (about 75 percent of Hershey's sales), which has seen higher price elasticity and less significant innovation in recent years."

Shares of Hershey closed down 2.6 percent Wednesday following the downgrade by Grainger, dampening a 6 percent gain over the past 12 months. The analyst's $105 price target – or where he expects the stock to be in one year – represents 8 percent downside.

For its part, Hershey was more optimistic on 2018.

"We feel very good about the snacking category. We continue to be a leader in that," said Hershey spokesperson Leigh Horner. "We feel like we have opportunities both in our core confectionery area as well as in the broader snacking space."

But it has also been looking to expand. CNBC reported on Sunday that Hershey submitted a final bid to acquire Nestle's U.S. confectionery business, including Butterfinger, Baby Ruth and Laffy Taffy. The Nestle business is valued between $2 billion and $2.5 billion, according to sources.