When a woman loses her husband, she should recite the following dua:
اَللَّهُمَّ اغْفِرْ لِي وَلَهُ وَأَعْقِبْنِي مِنهُ عُقْبَى حَسَنَةً
O Allah, forgive me and forgive him (the deceased), and bless me with a good substitute in place of him (the person whom I have lost).
عن أم سلمة قالت: فلما مات أبو سلمة أتيت النبي صلى الله عليه وسلم، فقلت: يا رسول الله إن أبا سلمة قد مات، قال: قولي: اللهم اغفر لي وله، وأعقبني منه عقبى حسنة ، قالت: فقلت، فأعقبني الله من هو خير لي منه محمدا صلى الله عليه وسلم (صحيح مسلم، الرقم: 919)
Hazrat Ummu Salamah (radhiyallahu ‘anha) reports: When (my husband) Abu Salamah (radhiyallahu ‘anhu) passed away, I came to Rasulullah (sallallahu ‘alaihi wasallam) and said, “O Rasulullah (sallallahu ‘alaihi wasallam), Abu Salamah has passed away.”
Rasulullah (sallallahu ‘alaihi wasallam) told me to recite the following dua:
اَللَّهُمَّ اغْفِرْ لِي وَلَهُ وَأَعْقِبْنِي مِنهُ عُقْبَى حَسَنَةً
Hazrat Ummu Salamah (radhiyallahu ‘anha) further says: “Allah Ta‘ala then granted me someone who is better than him, (i.e. Allah Ta‘ala granted me) Rasulullah (sallallahu ‘alaihi wasallam) (as a husband).”