Al-Adab Al-Mufrad, Book 40, Hadith 929 (In-Book)

Ibn 'Abbas said, "When someone is wished mercy, he should say, 'May Allah protect us and you from the Fire. May Allah have mercy on you.'"

حَدَّثَنَا حَامِدُ بْنُ عُمَرَ، قَالَ‏:‏ حَدَّثَنَا أَبُو عَوَانَةَ، عَنْ أَبِي جَمْرَةَ قَالَ‏:‏ سَمِعْتُ ابْنَ عَبَّاسٍ يَقُولُ إِذَا شُمِّتَ‏:‏ عَافَانَا اللَّهُ وَإِيَّاكُمْ مِنَ النَّارِ، يَرْحَمُكُمُ اللَّهُ‏.‏

sunnah.com