Language:
كتاب الأذان
10  
Call to Prayers (Adhaan)
(94)
Chapter: Is it permissible to one to look around in Salat (prayer) if something happens to one? Or can one look at something like expectoration in the directn of the Qiblah?
(94)
باب هَلْ يَلْتَفِتُ لأَمْرٍ يَنْزِلُ بِهِ أَوْ يَرَى شَيْئًا أَوْ بُصَاقًا فِي الْقِبْلَةِ
Sahih al-Bukhari 754

Narrated Anas:

While the Muslims were offering the Fajr prayer, Allah's Messenger (ﷺ) suddenly appeared before them by living the curtain of the dwelling place of `Aisha, looked towards the Muslims who were standing in rows. He smiled with pleasure. Abu Bakr started retreating to join the row on the assumption that the Prophet wanted to come out for the prayer. The Muslims intended to leave the prayer (and were on the verge of being put to trial), but the Prophet (ﷺ) beckoned them to complete their prayer and then he let the curtain fall. He died in the last hours of that day.

حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، قَالَ حَدَّثَنَا لَيْثُ بْنُ سَعْدٍ، عَنْ عُقَيْلٍ، عَنِ ابْنِ شِهَابٍ، قَالَ أَخْبَرَنِي أَنَسٌ، قَالَ بَيْنَمَا الْمُسْلِمُونَ فِي صَلاَةِ الْفَجْرِ لَمْ يَفْجَأْهُمْ إِلاَّ رَسُولُ اللَّهِ صلى الله عليه وسلم كَشَفَ سِتْرَ حُجْرَةِ عَائِشَةَ فَنَظَرَ إِلَيْهِمْ وَهُمْ صُفُوفٌ، فَتَبَسَّمَ يَضْحَكُ، وَنَكَصَ أَبُو بَكْرٍ رضى الله عنه عَلَى عَقِبَيْهِ لِيَصِلَ لَهُ الصَّفَّ فَظَنَّ أَنَّهُ يُرِيدُ الْخُرُوجَ، وَهَمَّ الْمُسْلِمُونَ أَنْ يَفْتَتِنُوا فِي صَلاَتِهِمْ، فَأَشَارَ إِلَيْهِمْ أَتِمُّوا صَلاَتَكُمْ، فَأَرْخَى السِّتْرَ، وَتُوُفِّيَ مِنْ آخِرِ ذَلِكَ الْيَوْمِ‏.‏
Reference : Sahih al-Bukhari 754
In-book reference : Book 10, Hadith 148
USC-MSA web (English) reference : Vol. 1, Book 12, Hadith 721
  (deprecated numbering scheme)