Taxpayer dies before filing return

A legal representative can file the return on behalf of the deceased person. Where it is required to put the name of the assessee, write down 'late (name of deceased) through legal heir (name of person filing)'. The legal representative will also have to submit a copy of the death certificate and surrender the PAN card of the deceased.
Any refund due to the taxpayer will go into the dead person's account. But under Section 159, the legal representative of the taxpayer shall be liable to pay any sum which the deceased would have been liable to pay if he was alive. However, this recovery cannot be more than the amount inherited by the legal representative from the deceased taxpayer.
A dead person is entitled to all the deductions and exemptions for the entire year, but tax is levied only on the income earned till his death. On his death, the income from his assets and the tax liability is transferred to his legal heirs. So if an individual died on 30 June 2011, his legal representative will have to file on his behalf for the financial year 2010-11 as also for the income for three months of 2011-12 in the next assessment year.
It's different in case the Karta of an HUF dies. The HUF is not a living entity, so the death of the Karta  does not lead to any change in taxation. The HUF continues to be taxed as before and the senior most male co-parcener in the HUF becomes the Karta.