Per IRS Instructions for Form 1040, page 93:
If your spouse died in 2017 and you didn't remarry in 2017, or if your spouse died in 2018 before filing a return for 2017, you can file a joint return. A joint return should show your spouse's 2017 income before death and your income for all of 2017. Enter "Filing as surviving spouse" in the area where you sign the return. If someone else is the personal representative, he or she must also sign.
The surviving spouse or personal representative should promptly notify all payers of income, including financial institutions, of the taxpayer's death. This will ensure the proper reporting of income earned by the taxpayer's estate or heirs. A deceased taxpayer's social security number shouldn't be used for tax years after the year of death, except for estate tax return purposes.
Claiming a Refund for a Deceased Taxpayer
If you are filing a joint return as a surviving spouse, you only need to file the tax return to claim the refund. If you are a court-appointed representative, file the return and include a copy of the certificate that shows your appointment. All other filers requesting the deceased taxpayer's refund must file the return and attach Form 1310.
To enter the death of a taxpayer or spouse in TaxAct: