Hadith 37

Sahih Bukhari

Book 18: Shortening the Prayers (At-Taqseer)

Chapter 19

Whoever cannot offer Salat while sitting, can offer Salat while lying on his side

باب إِذَا لَمْ يُطِقْ قَاعِدًا صَلَّى عَلَى جَنْبٍ

‘Ata’ said, “If one is unable to turn towards the Qiblah then he can offer the Salat (prayer) in whatever direction his face may be.” ​​
وَقَالَ عَطَاءٌ إِنْ لَمْ يَقْدِرْ أَنْ يَتَحَوَّلَ إِلَى الْقِبْلَةِ صَلَّى حَيْثُ كَانَ وَجْهُهُ.
Sahih al-Bukhari 1117
حَدَّثَنَا عَبْدَانُ، عَنْ عَبْدِ اللَّهِ، عَنْ إِبْرَاهِيمَ بْنِ طَهْمَانَ، قَالَ حَدَّثَنِي الْحُسَيْنُ الْمُكْتِبُ، عَنِ ابْنِ بُرَيْدَةَ، عَنْ عِمْرَانَ بْنِ حُصَيْنٍ ـ رضى الله عنه ـ قَالَ كَانَتْ بِي بَوَاسِيرُ فَسَأَلْتُ النَّبِيَّ صلى الله عليه وسلم عَنِ الصَّلاَةِ فَقَالَ ‏ ‏‏.‏
"‏ صَلِّ قَائِمًا، فَإِنْ لَمْ تَسْتَطِعْ فَقَاعِدًا، فَإِنْ لَمْ تَسْتَطِعْ فَعَلَى جَنْبٍ ‏"
`Imran bin Husain:

had piles, so I asked the Prophet (ﷺ) about the prayer. He said, "Pray while standing and if you can't, pray while sitting and if you cannot do even that, then pray Lying on your side."