(8) The Book on Fasting
كتاب الصوم عن رسول الله صلى الله عليه وسلم
(22) Chapter: What Has Been Related About Fasting On Behalf Of The Dead
(22) باب مَا جَاءَ فِي الصَّوْمِ عَنِ الْمَيِّتِ
Jami` at-Tirmidhi 716 
Ibn Abbas narrated:
"A woman came to the Prophet and said: 'My sister died while she had two consecutive months of fasting due.' So he said: 'Do you not see that if there was a debt due from your sister then you would have to pay it?' She said: 'Yes.' He said: 'Then the right of Allah is more appropriate.'"
حَدَّثَنَا أَبُو سَعِيدٍ الأَشَجُّ، حَدَّثَنَا أَبُو خَالِدٍ الأَحْمَرُ، عَنِ الأَعْمَشِ، عَنْ سَلَمَةَ بْنِ كُهَيْلٍ، وَمُسْلِمٍ الْبَطِينِ، عَنْ سَعِيدِ بْنِ جُبَيْرٍ، وَعَطَاءٍ، وَمُجَاهِدٍ، عَنِ ابْنِ عَبَّاسٍ، قَالَ جَاءَتِ امْرَأَةٌ إِلَى النَّبِيِّ صلى الله عليه وسلم فَقَالَتْ إِنَّ أُخْتِي مَاتَتْ وَعَلَيْهَا صَوْمُ شَهْرَيْنِ مُتَتَابِعَيْنِ ‏.‏ قَالَ ‏"‏ أَرَأَيْتِ لَوْ كَانَ عَلَى أُخْتِكِ دَيْنٌ أَكُنْتِ تَقْضِينَهُ ‏"‏ ‏.‏ قَالَتْ نَعَمْ ‏.‏ قَالَ ‏"‏ فَحَقُّ اللَّهِ أَحَقُّ ‏"‏ ‏.‏ قَالَ وَفِي الْبَابِ عَنْ بُرَيْدَةَ وَابْنِ عُمَرَ وَعَائِشَةَ ‏.‏
Grade :  Sahih (Darussalam)
Reference : Jami` at-Tirmidhi 716
In-book reference : Book 8, Hadith 35
English translation : Vol. 2, Book 3, Hadith 716