The alarm has been sounded. Financial gurus want you to get serious about retirement planning. Studies show that most Americans don’t have nearly enough saved; in fact, they’re dangerously behind.

But there’s more to it than that. Lifetime healthcare costs for a healthy 65-year-old couple retiring in 2015 who is covered by Medicare Parts B, D and a supplemental insurance policy will total $266,589. Add in dental, vision and other costs, and the figure goes up to $394,954. That’s a lot of money. If you saved $1 million – and most people haven’t – that represents about 40% of your nest egg (minus continued gains and Social Security).

Given that healthcare will eat up such a large amount of your retirement fund, you'd better plan for it correctly. The problem is that healthcare, starting with Medicare, isn’t easy to understand. Here’s an overview to help you make sense of it.

Medicare

Medicare is the nation’s healthcare system for seniors and some others. You generally qualify once you reach age 65 or have qualifying disabilities. You’ve probably seen commercials talking about all of the parts of Medicare but might be confused by what they are.

Part A covers any cost you incur by staying in a medical facility, including hospitals, skilled nursing facilities and hospices, among others. You don’t have to pay for Part A assuming you paid enough into Medicare while you worked. Keep in mind that you’re responsible for the first $1,288 in healthcare costs; after that, Part A kicks in. Also note that only a small fraction of long-term care costs are covered by Medicare. Consider long term-care coverage. We’ll talk about that later.

Part B covers doctors, tests, medical equipment, ambulance services and more. Generally, anything done to you is covered by Part B. You have to enroll in Part B if you don’t have “creditable coverage from another source”—a job or your spouse, for example. Your monthly premium will be around $123 per month, and you will have a $167 deductible starting in 2016.

More information about Part C will come later, but onto Part D, which is your prescription drug coverage. Part D is administered by a private insurance company and comes with a monthly premium based on your income level. If you make more than $85,000 per year, plan to pay around $73 per month.  If you make less, your premium goes down. (For more, see Medicare 101: Do You Need All 4 Parts?)

There’s also a deductible. Each plan has some latitude in how much of a deductible it charges but more than half report planning to charge the maximum Medicare allows: $360.

Medicare Advantage

There are all kinds of problems with Medicare. The one you should be most worried about is the coverage gaps. Part A has that $1,288 deductible and Part B requires that you pay 20% of your expenses regardless of how high your medical costs soar. That could be a lot of money.

Because of those gaps, most Medicare recipients purchase additional coverage to close the gaps. Medicare Advantage, also known as Part C, helps to plug those holes. After you have enrolled in Parts A and B, you can apply for Part C, which will cover what A and B – and often D – don’t. These Medicare Advantage plans are similar to private health insurance. You can purchase an HMO or PPO plan, and most will have some sort of limit on how much you pay out of pocket annually.

Like any plan, you have to compare your options and decide which is best for you. Medicare helps you by standardizing the plans. Each company must offer everything covered by original Medicare (Parts A and B) with the exception of hospice care.  Most will also offer some sort of prescription drug coverage, but not all do. You can use Medicare’s Plan Finder to find options in your area. (For more, see Five Distinct Features of Medicare Advantage.)

Medigap

A Medigap policy, also called Medicare Supplement Insurance, is an add-on to your original Medicare coverage that takes care of all of those coverage gaps. In case all of these letters weren’t confusing enough, Medigap coverage comes in Plans A, B, C, D, F, G, K, L, M and N. But the good thing about these letters is that all Medigap policies are standardized. You don’t have to compare coverage details as you would for a Medicare Advantage plan. If you want Medicare Plan F, you can compare different companies that offer the plan. It’s an apples-to-apples comparison. Of course, you'll owe a premium for a Medigap policy on top of your other Medicare premiums. (For more, see Medigap Vs. Medicare Advantage: Which is Better?)

What If You’re Still Employed?

The easy answer is that everybody must have health insurance. The Affordable Care Act mandates this. If you’re 65 and over and still working, you can use your employer’s coverage, your spouse’s coverage, Medicare or a combination of Medicare and other coverage.

Regardless, you may have to sign up for Parts A and B even if you still are working or on your spouse’s policy. In many cases, you don’t have to pay Part B premiums if you are covered under another policy.

Other times, employers might require you to sign up for Medicare to use it as co-insurance. Depending on the size of your company, Medicare or your company policy may pay first. These rules can get pretty complicated, so talk to your or your spouse’s HR department to learn more. (For more, see The Employee’s Guide to Medicare.)

The Other Problem with Medicare

Although it’s the nation’s largest insurer, doctors are opting out of the program with increasing frequency. Doctors cite lower reimbursement rates, long wait times to get paid and mandates that limit how they care for their patients. Before you switch your primary insurance from another plan to Medicare, find out if your doctor treats Medicare patients. If the answer is no, you will have to get a new doctor if you opt for Medicare. (For more, see What to Do When Your Doctor Doesn't Take Medicare.)

Long-Term Care Insurance

Ongoing care for an illness or just for somebody suffering the effects of aging can be expensive. Nursing home facilities alone can cost between $150 and $300 or more per day. Long-term care insurance covers all or a portion of these charges once you reach 65 or suffer a disabling condition earlier in life. Most agents recommend getting long-term care insurance once you reach your mid 50s.

Although you may be in fine health in your 50s, the longer you wait, the costlier the policies. As with most insurance products, there are different types of policies when it comes to long-term care insurance. The key is to find a policy with a rate that covers most costs and also adjusts upward with inflation.

A common policy would charge about $5,100 for a couple and pay a maximum of $200 per day with a 3% compound inflation rider.  With the average cost of nursing home care about $250 per day for a private room, this policy wouldn’t cover all of your costs. (For more, see Choosing Long-Term Care Insurance: Which is the Best?)

The Bottom Line

Health insurance is no easy subject to master, but before you get to your later years where you’ll likely need your health insurance to do more heavy lifting, it’s imperative that you get the right policies in place. In terms of retirement, make a plan with a qualified agent that you trust. You might not change anything now, but knowing what you should do at certain points in your life will help you forecast costs and their impact on your retirement savings.

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.