حَدَّثَنَا الْحُسَيْنُ بْنُ يَحْيَى بْنِ عَيَّاشٍ ، ثنا الْحَسَنُ بْنُ مُحَمَّدٍ ، ثنا إِسْمَاعِيلُ بْنُ عُلَيَّةَ ، عَنِ ابْنِ عَوْنٍ ، قَالَ : قَالَ مُحَمَّدٌ : " إِذَا قَالَ الإِمَامُ : سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ ، قَالَ مَنْ خَلْفَهُ : سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ ، اللَّهُمَّ رَبَّنَا لَكَ الْحَمْدُ " .
In another narration, there is this addition: When the Imam says "Sami' Allahu liman hamidah," the person behind should recite: "Sami' Allahu liman hamidah, Allahumma Rabbana lakal hamd." Allah has heard the praise of the one who praised Him, "O Allah! O our Lord! All praise is exclusively for You."