The Prophet ﷺ passed by him while he was praying and called him. He said, "I finished my prayer and then went to him."The Prophet ﷺ asked, "What prevented you from answering me?"He replied, "I was praying."The Prophet ﷺ said, "Did Allah not say, 'O you who believe, respond to Allah and the Messenger when he calls you to that which gives you life' [Anfal 8:24]? Shall I teach you the greatest surah before I leave the mosque?"He started to leave, and I said, "Messenger of Allah, what about what you said?"He answered, "Praise be to Allah, Lord of the worlds. It is the seven oft-repeated verses and the Magnificent Quran that has been given to me."
أخبرنا إسمعيل بن مسعود قال حدثنا خالد قال حدثنا شعبة عن خبيب بن عبد الرحمن قال سمعت حفص بن عاصم يحدث
ى أن النبي ﷺ مر به وهو يصلي فدعاه قال فصليت ثم أتيته فقال ما منعك أن تجيبني قال كنت أصلي قال ألم يقل الله عز وجل {يا أيها الذين آمنوا استجيبوا لله وللرسول إذا دعاكم لما يحييكم} ألا أعلمك أعظم سورة قبل أن أخرج من المسجد قال فذهب ليخرج قلت يا رسول الله قولك قال الحمد لله رب العالمين هي السبع المثاني الذي أوتيت والقرآن العظيم
Bukhari narrated it in the Book of Tafsir, chapter on what has been said about the Opening of the Book, hadith 4474, from the hadith of Shubah with this chain, and it is also in Sunan al-Kubra, hadith 985.