It is narrated from Sayyiduna al-Husayn bin Ali bin Abi Talib (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) said: "The sick person should pray standing if he is able. If he does not have that much ability, then sitting; and if he is not able to prostrate, then he should make gestures, keeping the gestures for prostration somewhat lower than the gestures for bowing. If he is not able to pray sitting, then he should pray on his right side facing the qiblah; and if he does not find the strength to pray lying on his right side either, then he should pray lying on his back, and in that case his legs should be towards the qiblah."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3678