Ponder this, beer drinkers. The malthouse that Rahr Malting Co. operates in Shakopee is the second-biggest in the world, producing enough malted barley annually for 11 billion cans of brew.

The 166-year-old company was making malt even before the use of cans revolutionized the beer industry. Now it is in the thick of another transformation.

While Rahr still counts the nation’s largest brewers as its prime customers, Big Beer has been floundering in recent years. The action is in craft brewing, and Rahr has positioned itself to serve up-and-coming craft brewers just as well as the makers of Bud and Coors Light.

Through its fast-growing subsidiary, Brewers Supply Group, Rahr sells brewers its own malt along with ingredients made by other firms, from hops and yeast to specialty flavorings like coriander and orange rinds.

“The craft movement has breathed so much life into the beer industry as a whole,” said William Rahr, great-great grandson of Rahr’s founder and president of Rahr Malting, Rahr Corporation’s malting subsidiary.

Malted barley is a bedrock ingredient in beer, and two of the nation’s biggest maltsters are based in the Twin Cities. Minnetonka-based agribusiness giant Cargill runs the largest U.S. malt house in Spiritwood, N.D. Together with Rahr, the two companies may control half of the U.S. malt market, which like the beer business is quite concentrated.

Malting barley is an ancient art, and Rahr has been doing it since 1847. That’s when German immigrant William Rahr set up a brewery in Manitowoc, Wis. He also established a malting operation that would carry on and prosper after Prohibition led to the brewery’s demise.

A few years after Prohibition’s repeal, the Rahr company built a malt house in Shakopee, aiming to take advantage of Minnesota’s then-vast barley fields. Rahr added four more malt houses at the same location over the next six decades, and moved its headquarters to Minnesota in 1962.

Rahr’s biggest customers are Anheuser-Busch and MillerCoors, which supplement their own in-house malt production — A-B has a large malthouse near Moorhead — with purchases from independent maltsters like Rahr and Cargill.

Rahr’s third-largest customer is its own subsidiary, Brewers Supply Group (BSG), which is devoted to craft beer, from home brewers to breweries like Summit Brewing.

“In terms of strategy, it was very smart for Rahr to establish a subsidiary that accommodates the needs of smaller brewers,” said Mark Stutrud, Summit’s CEO and founder.

St. Paul-based Summit has a long and “very close” relationship with Rahr, Stutrud said. When Summit opened in 1986 — a nascent time for craft beer — buying malt in 50-pound sacks was very difficult. Yet that’s what a beginner brewer needs, not a railcar or truckload of malt.

Rahr cut a deal with Stutrud: It would do sacks, if Summit picked them up in Shakopee. Summit later graduated to truckloads, and Rahr took steps to fully cater to craft brewing.

In 2004, it bought Mid-America Brewing Supply, a Kasota, Minn., craft beer ingredients distributor. Rahr quickly bought three more similar companies, christening its new business Brewers Supply Group. It snapped up three more distributors over the next six years. Today, BSG’s client lists spans brewpubs to large craft brewers like Boston Beer Co., maker of Sam Adams.

“BSG has offered us a vehicle to grow,” said Rahr Corp. CEO Gary Lee. BSG’s sales now make up roughly a third of Rahr Malting Co.’s North American revenue. And it sports nice profit margins. “With 50-pound bags [of malt] vs. railcars, your margins start to get better,” Lee said.

A family-owned firm, Rahr discloses little financial information, but says its sales are in the “several-hundred-million-dollar range.” It employs about 300, just over half of whom work in Shakopee, where Rahr has its headquarters. The company has a grain elevator in Taft, N.D. — the heart of barley country — and a smaller malting operation in Alberta, Canada.

A look at the broader beer business shows both the problems and opportunities facing Rahr. The traditional market seems tapped out.

From 2009 through 2011, total U.S. beer shipments fell an average of 1.3 percent annually, hurt by sluggish sales of mainstream brew, according to Beer Marketer’s Insights, a trade publication. Last year, the industry turned around with a 1.5 percent increase in shipments, but that was largely due to the craft segment’s strong performance.

Craft beer makes up less than 10 percent of the overall beer market by volume. But last year, production rose 15 percent while dollar sales jumped 17 percent, according to the Brewers Association, a trade group for craft brewers. The segment has had double-digit volume growth every year since 2006, except in 2008 and 2009 when the economy tanked.

As a bonus for maltsters, craft beers require proportionately more malt than mainstream U.S. beers.

That’s because craft brewers generally use only four foundation ingredients: water, yeast, hops and malted barley or sometimes malted wheat. Conventional brewers often supplement barley malt with rice and corn, which cuts costs and imparts a lighter body that many beer drinkers prefer.

But rice and corn are forbidden in the craft world: The base of beer is not to be messed with. “Malt is the soul of beer,” Stutrud said. “And the fact that malt is considered the soul of beer is a pretty big statement.”