These days, workers in line to get a pension from their employer when they retire may consider themselves lucky. But with weak returns on their investment portfolios, pension funds face more concerns than ever about their health and ability to meet their obligations to employees.

A new report (link opens PDF file) from S&P Dow Jones Indices looks at the current state of pension funds among companies within the S&P 500. Although the report gives some reasons for workers and investors to be optimistic, many of its results are troubling.

Record underfunding
The very first thing the report reveals is that pension fund liabilities and underfunding are both at record levels. Because of flat performance for U.S. stocks and double-digit losses in many international markets, the amount by which pensions are underfunded soared from $245 billion in 2010 to $355 billion in 2011. That left pensions less than 79% funded last year, compared to nearly 84% funding levels two years ago.

What's potentially more troubling, though, is how pension funds have responded to the situation. Even as their expected returns declined slightly to 7.6%, pension funds raised their allocations to bonds and other fixed-income investments by 5 percentage points to nearly 41%, while cutting back on stocks. The current 48.4% to 40.9% mix of stocks to bonds makes pension funds' return assumptions look dangerously aggressive, especially given extremely low bond rates that are well below historical averages.

Where the problems are
Drilling down on particular sectors, you can see some big differences. Energy companies have the overall worst underfunding problem, with assets covering only about 68% of anticipated obligations. Financials, on the other hand, are in much better shape relatively, with overall funding at 88%.

When it comes to sheer dollar figures, some of the biggest companies stand out. Looking only at pensions and excluding other post-employment benefits like health insurance, General Electric (NYSE: GE) had the highest shortfall at $21.6 billion, while ExxonMobil (NYSE: XOM), Ford (NYSE: F), and Boeing (NYSE: BA) all weighed in with underfunding amounts of $15 billion or more. On a percentage basis, though, JDS Uniphase (Nasdaq: JDSU) was among the worst underfunded, although its pension obligations only amount to $109 million.

A solution?
Even with pension funds not having enough assets to meet obligations, the greater question is whether the companies themselves have the money to pay for those obligations when they come due. The S&P Dow Jones Indices report notes that cash among S&P 500 companies is near record highs, with more than $1 trillion in cash and equivalents on their balance sheets as of the end of the first quarter of 2012. Those cash balances are theoretically available to fund pensions now if companies were so inclined.

But counting on cash to be there when retirees actually need it for pension benefits is a dangerous game to play. Companies have competing demands on their cash, whether for strategic acquisitions, dividends and share buybacks to benefit investors, or compensation packages for executives and other employees. Yet given the earnings hit that companies take when they take charges for pension contributions, it's easy to understand when companies choose not to accelerate contributions beyond what's legally required.

A generation gap
With the shift away from pension plans toward defined-contribution plans like 401(k)s, the baby boomer generation is arguably the most vulnerable to retirement savings shortfalls. Younger workers don't expect to get pensions, so they can use the decades they have left before reaching retirement age to save on their own. But boomers who are being pushed toward 401(k) plans late in life are getting the worst of both worlds: decreased or eliminated pension benefits, but without time to make up savings shortfalls from their own paychecks.

With pensions becoming more controversial, especially among public employees, the funding issue definitely isn't going away anytime soon. Investors need to understand the funding status of the stocks they own, while workers can't afford not to know where their employers stand and what risks they face to the benefits they're counting on receiving.

When it comes to investing for retirement, taking control of your own destiny is powerful. Get some ideas for stocks you can trust for the long haul from the Fool's special report, "3 Stocks That Will Help You Retire Rich." Get your free copy today while it lasts!

Meanwhile, even with pension shortfalls, both GE and Ford have some good prospects. Learn more about each with our brand-new premium report on GE and our similar report on Ford.