They're unpredictable, they're expensive, and they could wipe out your retirement savings in a single blow. Medical costs, especially those related to sudden illness, are far and away the biggest X factor in retirement planning.
Fidelity Investments' Benefits Counseling division estimates a 65-year-old couple with Medicare coverage retiring this year will need an average of $220,000 to cover medical expenses throughout retirement.
But that doesn't include any costs associated with nursing-home care, which average more than $50,000 a year. It also fails to account for the fact that out-of-pocket insurance costs are continuing to rise, making it harder to project future health-care expenditures.
"A lot of people think, 'Oh, when I hit 65, I'll be eligible for Medicare and that will solve all of my cost issues,'" said Nicole Duritz, vice president of health and family for AARP. "While Medicare is a very comprehensive insurance program … like all insurance policies, there are things that are not covered."
Effective savings strategies, however, can help create a cushion in your nest egg for health-care needs.
So, too, can lifestyle changes that reduce your need for medical intervention. If, for example, you quit smoking or, if prediabetic and seek early intervention, you are far more likely to remain healthy, Duritz said.
"There are things you can do that will make your health-care costs more affordable," she said.
To budget effectively for health-care costs in retirement—including insurance premiums, copays, deductibles, dental and vision care, hearing aids and private nursing—you must first estimate your expenses.
Start with your life expectancy, using the online calculator available from the Social Security Administration, and adjust the result to account for personal health.
While knowing your family history is important in helping to understand what you may face as you age, it isn't always an accurate predictor for future generations, said Deana Arnett, a certified financial planner and senior planning consultant with Rosenthal Wealth Management Group.
"For example, heart disease has been a devastating force in my family for generations," she said. "We all do a bit more to take care of heart health now by getting regular checkups and paying special attention to what we eat.
"Genetics certainly plays a part in your health, but with so many resources, it doesn't have to be a foregone conclusion," she added.
The website HealthcareBluebook.com provides cost estimates of various medical procedures and prescriptions by Zip code.
Arnett said retirees can use that data to estimate today's cost of items not covered by insurance and adjust for inflation (6.5 percent is reasonable) to create an estimate of future costs.
AARP also offers a health-care cost calculator that allows users to explore how much they might shell out for medical care and, more importantly, how much they could save by improving their health.
In planning for future medical costs, much depends on what insurance benefits you have and which level of Medicare coverage you select, AARP's Duritz said.
The military, labor unions and some private companies still offer retiree health benefits that could pick up where Medicare leaves off, according to Arnett.
Read MoreHow to maximize Social Security
"The most important thing is to understand what your coverage will and will not cover," she said, noting working seniors must be particularly mindful. "Medicare costs go up as your income goes up, so you want to make sure you understand how the increased premiums will affect your bottom line."
High-income earners (singles making more than $214,000 per year and married couples earning more than $428,000) can expect to pay $335.70 per month for Medicare Part B.
When choosing a Medicare plan, be sure, too, to calculate your out-of-pocket costs under every scenario, said Duritz.
You must choose between "original" Medicare coverage, which includes Medicare Part A (for hospital care) and Part B (for outpatient care), and a Medicare Advantage Plan that works more like an HMO.
Those who opt for original Medicare often pay extra for prescription drug coverage and/or supplemental insurance, known as Medigap, to help pay for some of the costs not covered by their plan, including copays and deductibles.
Those with Medicare Advantage already receive some of those benefits within their plan, but they also pay a higher premium.
Your out-of-pocket expenses can vary dramatically, depending on which Medicare plan you choose and how it integrates with any retirement health benefits you may have. Duritz said retirees should seek guidance before they enroll.
To maximize your savings and meet future medical bills, it's also important to invest for growth, said Donald Roy, a CFP with New England Wealth Advisors.
Unless retirees have enough already banked to cover projected health-care costs, he said, they must resist the temptation to over-allocate to fixed-income investments, such as money market funds and Treasurys. Given today's meager interest rates and the corrosive effects of inflation, Roy added, such strategy would guarantee a loss of purchasing power.
"If someone is allocating specific assets for health care, growth is still an important objective," he said. "The monies need to have the ability to grow above the medical inflation rate, which has historically been higher than the consumer price index," the broadest measure of inflation.
If a health savings account is available to you during your working years, it's also wise to take advantage, Roy said. HSAs are funded with pretax contributions, and distributions are tax-free if used for qualifying health expenses.
Read MorePlanning helps with health costs
To create a health-care safety net, retirees might also delay Social Security benefits by even a few extra years to lock in a permanently higher benefit, said AARP's Duritz.
Or you could consider a reverse mortgage, which enables borrowers who are age 62 and older to convert a portion of the equity in their home into cash.
There are no restrictions on how the proceeds must be used, and the balance need not be repaid until the last surviving dies or leaves the home.
Payments received from a reverse mortgage are income-tax-free and do not impact Social Security or Medicare benefits.
However, because reverse mortgages can be pricey—involving closing costs, mortgage interest payments and origination fees—they are best suited for seniors who plan to remain in their homes long-term.
"Reverse mortgages are structured that you never owe more than the home is worth at the time the loan is repaid, but the interest can eat up the remaining equity if the loan isn't repaid for a very long time," said Arnett at Rosenthal Wealth Management Group.
Another big negative: Borrowers who fail to stay current on their property taxes and homeowner's insurance or let their property fall into disrepair may face foreclosure.
Finally, there is long-term-care insurance, which is designed to cover services and supports not covered by traditional health insurance, including assisted living, home care, adult day care and hospice.
Such coverage provides peace of mind, but it doesn't come cheap and you won't qualify if you're in poor health.
The average premium for a 60-year-old couple is roughly $3,000 per year, according to the American Association for Long-Term Care Insurance.
Of course, there's no way to know exactly how much you'll need to cover future health-care costs.
However, by estimating expenses, investing for growth and adopting a healthier lifestyle, you can help soften the blow and minimize the risk of outliving your savings.
—By Shelly Schwartz, special to CNBC.com