كتاب الصيام
13  
The Book of Fasting
(27)
Chapter: Making up fasts on behalf of the deceased
(27)
باب قَضَاءِ الصِّيَامِ عَنِ الْمَيِّتِ
Sahih Muslim 1148 a

Ibn 'Abbas (Allah be pleased with both of them) reported:

A woman came to the Messenger of Allah (ﷺ) and said: My mother has died, and fasts of a month are due from her. Thereupon he said: Don't you see that if debt was due from her, would you not pay it? She said: Yes (I would pay on her behalf). Thereupon he said: The debt of Allah deserves its payment more than (the payment of anyone else).
وَحَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، أَخْبَرَنَا عِيسَى بْنُ يُونُسَ، حَدَّثَنَا الأَعْمَشُ، عَنْ مُسْلِمٍ، الْبَطِينِ عَنْ سَعِيدِ بْنِ جُبَيْرٍ، عَنِ ابْنِ عَبَّاسٍ، - رضى الله عنهما - أَنَّ امْرَأَةً، أَتَتْ رَسُولَ اللَّهِ صلى الله عليه وسلم فَقَالَتْ إِنَّ أُمِّي مَاتَتْ وَعَلَيْهَا صَوْمُ شَهْرٍ ‏.‏ فَقَالَ ‏"‏ أَرَأَيْتِ لَوْ كَانَ عَلَيْهَا دَيْنٌ أَكُنْتِ تَقْضِينَهُ ‏"‏ ‏.‏ قَالَتْ نَعَمْ ‏.‏ قَالَ ‏"‏ فَدَيْنُ اللَّهِ أَحَقُّ بِالْقَضَاءِ ‏"‏ ‏.‏
Reference : Sahih Muslim 1148a
In-book reference : Book 13, Hadith 199
USC-MSA web (English) reference : Book 6, Hadith 2554
  (deprecated numbering scheme)