When you can't pay your medical bills they'll most likely be sent to collections and when you die the debt collector will not be able to collect the debt so they'll basically have to write the debt off as a loss.
The same is true to whom you owe the medical bills too they'll have to write the medical bills off as a loss once the person dies.