Some of the country's biggest craft brewers are struggling with falling sales, hurt by a glut of competitors crowding retail shelves and moves by megabrewers to scoop up some of their rivals.

"It's more competitive than it's ever been," said Ken Grossman, founder and chief executive of Sierra Nevada Brewing Co., the No. 2 U.S. craft brewer by volume.

His company's retail-store sales have fallen by 7.5% this year as of July 16, according to Beer Marketer's Insights. The brewer's shipment volumes fell 6.9% in 2016 -- its first decline since Sierra Nevada was founded in 1980. Just two years ago, the Chico, Calif., company logged record sales after opening a second brewery in North Carolina.

After years of strong gains, American craft brewers are now bracing for a shakeout. Shipments are falling for many independent brewers stuck in the middle between local niche brands and competitors that were bought by heavyweights such as Anheuser-Busch InBev and Molson Coors.

Besides Sierra Nevada, those losing ground include Sam Adams maker Boston Beer Co., the biggest independent brewer, as well as smaller producers such as F.X. Matt Brewing Co., which brews Saranac in upstate New York, and Abita Brewing Co. in Louisiana, according to Beer Marketer's Insights.

Benj Steinman, president of the tracking firm, said many craft brewers trying to push into regional and national markets are finding they hit a wall once they surpass 100,000 barrels. Some have stretched themselves too thin and lost ground in their home markets, while others took on too much debt to expand brewing capacity, brewers said. As they expand, they also lose the cachet of being a local brand -- something many consumers seek out.

"They used to say a rising tide lifts all boats. And it's definitely not that now," Mr. Steinman said. His firm estimates that shipment volumes declined for 16 of the top 36 craft-style U.S. brewers last year.

The troubles have continued this year. Retail-store sales of craft-style beers -- from brewers big and small -- fell $143 million to $2.3 billion in the first half of 2017, according to data from Nielsen. Craft beer shipments grew for years in the double digits, even as overall beer sales fell. But craft demand began to decelerate in 2016.

"We really had to put our big-boy underpants on and up our game," said Sam Calagione, founder and CEO of Dogfish Head Craft Brewery in Milton, Del., whose volumes were flat last year. "Is it too crowded, the market? We're almost at the pace of two new breweries a day. That pace is not sustainable."

Shipments are still rising for many of those craft brewers that sold themselves to Big Beer, including Lagunitas, which was bought by Heineken in May; Goose Island, owned by AB InBev since 2011; and Ballast Point, which was purchased by Constellation Brands Inc. for $1 billion in 2015. Those brands benefit from their parent companies' distribution networks, capital and marketing.

Earlier this month, Constellation, which distributes Corona in the U.S., expanded its push into the craft beer market, acquiring South Florida's small Funky Buddha Brewery for an undisclosed amount. The microbrewery, which had 30% volume growth so far this year, was looking to expand distribution beyond Florida and start production in cans. Those moves would have required a capital investment of between $6 million and $8 million, its founders said in an interview.

"Local is still growing, and the larger ones are having problems," co-founder Ryan Sentz said. "We saw that as a potential roadblock in the future. We knew that aligning ourselves with a partner would be exponentially easier."

Microbreweries like Funky Buddha continue to grow fast: The 5,000 small brewers shipping fewer than 100,000 barrels a year had an average volume growth last year of 14%, double the growth rate for the craft category overall, according to Beer Marketer's Insights.

Dogfish Head, Saranac, Abita and other brewers grappling with soft sales say they are cutting costs, spending more on marketing and speeding up the launch of new products. Some are trying to attract fans of whiskey, wine or margaritas with beers aged in casks, infused with grapes or flavored with limes.

After a January product recall, Sierra Nevada is getting "back on track, " Mr. Grossman said, with increased marketing and an accelerated program for testing new products. Those experimental brews are often released first through the company's tasting rooms or its rare-beer club.

Boston Beer recently surprised analysts with second-quarter results that showed sales declines had moderated; shipments to retailers fell 3%, after a 14% drop in the first quarter. To regain ground, executives say the company is cutting costs and pitching its products -- including cider and hard tea -- to younger and more diverse consumers.

"When the growth stopped, we had overbuilt," Boston Beer's chief executive Martin Roper said in an email. "Our first reaction was to wait to see if we could grow again...so it was a little bit of denial about the new flat-to-negative trends continuing."

Write to Jennifer Maloney at jennifer.maloney@wsj.com