Medicare is among the fastest growing line items in the federal budget. Even with over $500 billion going toward the program annually, it still does not cover all of seniors' health costs. A quarter of Medicare beneficiaries end up spending all their assets on health care in the last five years of life.

That's what Amy Kelley, a professor at Mt. Sinai School of Medicine, found in a first-ever look at the out-of-pocket costs seniors face when medical problems mount near the end of life. She used the Health and Retirement Survey, a longitudinal study that has lots of data on medical spending in old age.

The average Medicare beneficiary spent s $38,688 out-of-pocket during the last five years of life. There was, as you can see in this graph, a lot of variation:

Twenty-five percent spent all remaining assets, including any housing or real estate they might own. The frequency tended to be lower among Medicare beneficiaries who were married; higher among those who were single.

Excluding housing assets, the level of seniors spending all assets rises to 43 percent. When Kelley broken down the costs by type of disease, she found that dementia patients tended to have the highest costs. That probably has to do with the fact, as she points out, that Medicare does not cover non-rehabilitative nursing home care.

There's not much in the Affordable Care Act to deal with this; the CLASS Act, meant to create a long-term care program, will not be implemented after it was found to be financially unsound.

"As more Baby Boomers retire," Kelley writes, "A new generation of widows or widowers could face a sharply diminished financial future as they confront their recently-depleted nest egg following the illness and death of a spouse."