MolsonCoors, maker of Coors Light and Blue Moon beers, posted lower than expected earnings on Tuesday, as commodity costs rose while sales dropped.

The beer-maker was affected in part by higher oil prices, cutting into both profits as well as into discretionary consumer spending. The company had a second quarter net income of $222.8 million, or $1.18 per share, down from $237.2 million, or $1.27 per share, a year ago.

Average analyst expectations had the company at $1.30 earnings per share. The company also missed revenue expectations of $953.6 million, as the company reported revenue of only $933.6 billion.

The company tried price reductions and benefited from a favorable foreign exchange, but the positives were offset by a few factors.

"...were offset by the impact of continuing weak economic conditions, commodity inflation and investments in our international business in the quarter," MolsonCoors chief executive Peter Swinburn said.

The company also announced it will buy back up to $1.2 billion in Class B common stock to try to improve shareholder value.

"In the past several years, we have continued to strengthen the company's balance sheet, added new brands and businesses in select markets, and doubled our dividends," Swinburn said. "The combination of substantial cash generation and cash balances now also permits us to use our cash to increase returns to shareholders through a stock repurchase program."

Earlier in the day parent company MillerCoors announced a 2.6 percent net income increase, though it was also affected by higher costs this quarter.

"We delivered profit growth in the second quarter despite a weakening economy, combined with an array of headwinds, including record rainfall in key markets and high fuel prices, all of which dampened consumer spending on beer," said MillerCoors CEO Tom Long.

The company has a U.S. beer market share of 30 percent, behind only Anheuser-Busch InBev's close to 50 percent share.