Companies are going to have to contribute some serious money to shore up their lilting pension plans this year, but there’s a silver lining: higher earnings.

In a Dec. 7 analysis, UBS analysts spell out how contributing to the company plan could handsomely help the bottom line.

It has a lot to do with the peculiarities of pension accounting.

As UBS accounting expert Janet Pegg wrote in the report,  companies that sponsor pension plans mostly don’t use current market results when determining how much their plans cost them in a certain year.  Instead they use an “expected long-term rate of return”  to calculate how their investments did.

Currently, that expected return is usually between 7.5 percent and 8.5 percent.

So if a company put $100 million into its plan in 2011, and it was expecting a 7.5 percent rate of return on investments, it automatically gets $7.5  million in net income added to the bottom line. That goes even for a year like last year when the S&P 500 returned almost zero, and many global markets far less. On the books, pension plans looked to be doing quite well.

In reality, pension plans have not been doing that well.  According to UBS, pensions’ average annual return over the past decade was only about 5 percent, but they  expect to do better, and thus their earnings rise.