Dying is such a bad thing that the IRS has a couple of ways to help your loved-ones deal with the loss. One of the tax benefits is a concept called "stepped up basis" which applies in the area of capital gains tax. What this means is that assets you own at your death, with a few exceptions, will have a new tax basis equal to the value on your date of death. In order to understand the benefit of this tax benefit, consider this illustration:
You bought shares of a stock for $10,000. That is your cost basis. Your investment does great (unlike my selections) and it has increased in value to $15,000. You decide to take cash out and take your money. You will be capital gains tax on the increase of $5,000. (Market value less your cost basis.)
However, let's say right before you were able to sell the stock, you step on a rake in your yard, stumble backwards and get hit by a Hummer and killed instantly. Your estate would be able sell the stock and the new cost basis would be equal to the market value at the time of your death ($15,000 in this case.) Thus, if the stock was sold the same day, there would be no capital gains tax at all. Not a bad deal...just not for you.
And who said there was nothing good about dying?