If you happen to get lucky and win a massive lottery jackpot shortly before you pass away, what happens to the money depends on several factors.