عن عمران بن حصين -رضي الله عنهما- قال: كانت بي بَوَاسيرُ، فسألت النبي -صلى الله عليه وسلم- عن الصلاة، فقال: «صَلِّ قائما، فإن لم تستطع فقاعدا، فإن لم تستطع فعلى جَنْبٍ».
[صحيح.] - [رواه البخاري.]
المزيــد ...

Imrān ibn Husayn (may Allah be pleased with him) reported that he was suffering from hemorrhoids (piles), so he asked the Prophet (may Allah's peace and blessings be upon him) about the prayer and he said: "Pray standing; if you cannot, then sitting; if you cannot, then lying on your side."
[Sahih/Authentic] - [Al-Bukhari]

Explanation

This noble Hadīth explains the manner of praying for the person having hemorrhoids, suffering a pain when standing, or having similar excuses. The Prophet (may Allah's peace and blessings be upon him) stated that prayer by default is offered in a standing position. However, if the person is unable to stand, he should pray sitting. If one is not able to pray sitting, then he may pray lying on his side.

Translation: French Spanish Turkish Urdu Indonesian Bosnian Russian Bengali Chinese Persian Tagalog Indian Kurdish Hausa Portuguese Malayalam Telgu Swahili
View Translations
1: The order of the different conditions of the obligatory prayer for a sick person should be observed. He is obligated to stand if he is able to, for this is one of the pillars of the obligatory prayer, even if he has to lean upon something like a staff or a wall.
2: If he cannot stand or finds difficulty in doing so, he is obligated to pray while sitting, even if he has to lean upon something, and he is required to bow down and prostrate if he is able to. If he cannot sit or finds difficulty in doing so, he can pray while reclining on his side, preferably the right one. If he prays while lying down towards the Qiblah (prayer direction), his prayer is valid. If he is unable to pray like this, he can nod his head, with the nod for prostration being lower than that for Rukū‘ (bowing) to distinguish between these two pillars and because prostration is lower than Rukū‘.
3: One should not shift from one condition to an easier one unless he is unable to do the former one or finds difficulty in doing it. Moving from one condition to another is pertinent to one’s inability.
4: The difficulty that permits one to pray while sitting is the hardship that dispels one’s Khushū‘ (presence of mind and humility). In fact, Khushū‘ is the greatest objective of prayer.
5: The excuses permitting one to pray while sitting are numerous and not limited to illness. Examples include when the ceiling is too low and he cannot get out of such a place, and praying in a ship, car, or plane when needed and unable to stand up. All of these are valid excuses for this.
6: Prayer does not cease to be due as long as a person retains his sanity. An ill person who cannot nod with his head may nod with his eyes, lowering it a little for Rukū‘ and more for prostration. If he is able to recite with his tongue, he should do so or otherwise recite with his heart; and if he cannot nod with his eyes, he can pray with his heart.
7: The Hadīth generally indicates that such a person may pray while sitting in whatever manner he wishes, a view held by the consensus. The difference is over which is better. The majority of the scholars held that he should sit cross-legged when he should stand and after rising from Rukū‘, and that he should practice Iftirāsh (stretching the left leg and sitting on it and erecting the right foot) at the position of rising from prostration.
8: Allah’s commands should be observed according to one’s ability and capacity. Allah Almighty does not charge anyone beyond his capacity.
9: This shows the ease and leniency of the Islamic Shariah and that it is as Allah Almighty says: {And He has not imposed upon you any hardship in religion.} [Surat al-Hajj: 78] {Allah wants to lighten your burdens.} [Surat an-Nisā’: 28] The mercy of Allah Almighty towards His servants is vast.
10: The foregoing relates to the obligatory prayer. As for supererogatory prayer, one may offer it while sitting, even without excuse. Yet, if he does so for a valid excuse, he will receive the reward in full, and only half the reward if he does so without excuse, as authentically reported in the Sunnah.