Sahih Bukhari Volume 002, Book 020, Hadith Number 218.
Hadith Section/Book: Sahih Bukhari Sahih Bukhari Book 20. Shortening The Prayers (At-Taqseer)
Narated By '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."