In most cases you can't defame the dead, but there are exceptions.
In Rhode Island, there's a law about libeling the dead in their obituary:
Whenever a deceased person shall have been slandered or libelled in an obituary or similar account in any newspaper or on any radio or television station within three (3) months of his or her date of death, and the account would, if death had not ensued, have entitled the party injured to maintain an action and recover damages in respect to the libel, the person who or corporation which would have been liable if death had not ensued shall be liable to an action for damages, notwithstanding the death of the person.
In Texas, there's also a law about libeling the dead:
A libel is a defamation expressed in written or other graphic form that tends to blacken the memory of the dead or that tends to injure a living person's reputation and thereby expose the person to public hatred, contempt or ridicule, or financial injury or to impeach any person's honesty, integrity, virtue, or reputation or to publish the natural defects of anyone and thereby expose the person to public hatred, ridicule, or financial injury.
It's possible that something you say about a dead person could affect the reputation of someone else who is still living. And of course it's possible that something you say about a dead person could have other effects in unrelated areas of law ("Your father died while robbing a bank, and our insurance therefore won't issue a payout for his death") but that might be outside the intended scope of the question.