Two important reminders in this slideshow from Forbes:
... You can take a distribution from an IRA or 401(k) penalty-free to pay for certain medical expenses. Be careful: Beginning in 2013, only expenses that exceed 10% of your adjusted gross income are eligible, and you must pay those expenses in the same year you take the distribution. Read more
... If you're unemployed, you can take money penalty-free--from an IRA but not a 401(k)--to pay for health insurance. To qualify, you must be on unemployment insurance for at least 12 weeks, and you can't take the money out more than 60 days after getting a new job.
Of course, while the two methods above are penalty-free, they are not tax-free. You would still have to claim the money as income.