إِنَّ للهِ مَا أَخَذَ، وَلَه ُُ مَا أَعْطَى، وَكُلُّ شَيءٍ عِنْدَه ُُ بِأَجَل ٍ مُسَمّى.ً.. فَلْتَصْبِرْ وَلْتَحْتَسِبْ. أَعْظَمَ اللَّهُ أَجْرَكَ، وَأَحْسَنَ عَزَاءَكَ، وَغَفَرَ لِمَيِّتِكَ
‘Verily to Allah, belongs what He took and to Him belongs what He gave, and everything with Him has an appointed time…and then he r ordered for her to be patient and hope for Allah’s reward.’
The words (faltasbir waltahtasib) are commands in the feminine 3rd person form, so they will need to be changed in respect to whom is being addressed.
…and one can also say:
‘May Allah magnify your reward, make better your solace and forgive your deceased.’
Note: This is the saying of some of the scholars, not a hadeeth.
Source: Hisnul Muslim