If you're retiring this year, plan on spending $285,000 in the coming years on your healthcare, according to Fidelity Investments. Although Medicare provides valuable financial help to people over age 65, it doesn't pay for everything, and as a result, rising healthcare costs could take a big chunk out of your Social Security and other income in retirement.

Why Medicare falls short

Medicare pays for hospitalization, doctor's visits, laboratory tests, and more, but it doesn't pay 100% of these costs. You must pay deductibles and coinsurance -- and unfortunately, there's no out-of-pocket limit on how much you must pay for your healthcare every year.

A retired couple looks surprised by what they're reading on a computer monitor.

IMAGE SOURCE: GETTY IMAGES.

Medicare Part A provides coverage for hospitalization, Medicare Part B covers general healthcare costs, such as doctor visits, and Part D covers drug costs. Most people don't pay a premium for Medicare Part A, but you'll pay Medicare Part B premiums, and if you enroll in a Part D program, you'll pay premiums for that coverage too.

The Medicare Part A deductible is $1,364 in 2019. After the deductible is met, your inpatient hospital costs are covered by Part A for 60 days. You'll be subject to $341 per day in coinsurance beginning on day 61, though. And you'll pay $682 per day in coinsurance beyond 90 days, until your 60 lifetime reserve days are gone. If that happens, you'll be on the hook for 100% of your costs. Also, if you wind up in a skilled nursing facility, you'll pay $170.50 per day in coinsurance from days 21 through 100 in 2019.

The standard monthly premium for Medicare Part B is $135.50 for 2019, but if you're a high-income earner, you could pay up to $460.50 in premiums. The Medicare Part B deductible is $185 in 2019. Generally, you'll pay 20% coinsurance on all healthcare services covered by Part B, including doctor services if you're being treated in a hospital as an inpatient.

Medicare Part D plans are offered by private insurers, so monthly premiums, deductibles, and cost-sharing vary. However, the average Part D premium is about $33, and the standard deductible is $415 in 2019. After your deductible is met, the standard amount most people pay in cost-sharing on up to $8,140 in total drug costs is 25%.

Medicare doesn't cover most dental care, hearing aids, or vision care, either.

Healthcare: A big threat

After considering Medicare's limitations, Fidelity's number crunchers find that the average man and woman retiring in 2019 will spend $135,000 and $150,000 each on out-of-pocket healthcare during retirement, or a total of $285,000 for a retired couple.

Even worse, Fidelity's calculation doesn't include costs associated with long-term care, such as assisted living. A one-bedroom unit in an assisted-living community cost $3,628 per month in 2016, while a semiprivate room in a nursing home cost nearly $7,000 per month, according to the U.S. Department of Health and Human Services.

If you require long-term care, then your healthcare costs in retirement could easily wipe out a lifetime in savings. The average American in their 40s has only saved $63,000 for retirement, and one in five people haven't saved anything for retirement yet.

A senior holding a health aide's hand.

IMAGE SOURCE: GETTY IMAGES.

What to do?

The prospect of hundreds of thousands of dollars in healthcare costs in retirement is daunting, but there are steps you can take to reduce the risk of healthcare causing financial insecurity in your golden years.

Contributing to a health savings account (HSA) while you're working can provide tax-deductible and tax-free money for healthcare expenses in retirement if you qualify. If you're 65, enrolling in a Medigap plan could pay off, because it pays deductibles and other out-of-pocket costs that traditional Medicare doesn't.

Yet another option is to consider enrolling in a Medicare Advantage plan. These plans roll together Medicare parts A, B, and D, and since they include out-of-pocket annual maximums, they could help you avoid bankruptcy caused by illness or injury. It may also make sense to consider long-term care insurance as part of your planning.

Overall, the key to avoiding being blindsided by healthcare costs in retirement is preparation. Many retirees are surprised to learn that Medicare doesn't pay 100% of their healthcare costs, and as a result, they discover too late that they've undersaved for retirement. To avoid that fate, it's important to make sure you're making the most of employer-sponsored retirement plans, IRAs, and HSAs now.