Shama-il Tirmidhi Chapter 038, Hadith Number 001 (242).

Baraa Radiyallahu 'Anhu reports: "When Rasulullah Sallallahu 'Alayhi Wasallam retired, he put his right hand under his right cheek, and recited this du'aa: Rabbi qini adhaa-baka yauma tub-a-thu 'ibaadaka.

Translation...

 O Allah, save me from Your punishment on the day of qiyaamah".

Commentary
It is stated in the Hisn Haseen that Sayyidina Rasulullah Sallallahu 'Alayhi Wasallam recited this du'aa thrice. This has also been reported by 'Abdullah bin Mas'ud Radiyallahu 'Anhu in a narration. We find that this was the general Practice of Sayyidina Rasulullah Sallallahu 'Alayhi Wasallam, which many Sahaabah Radiyallahu 'Anhum had witnessed. Although Sayyidina Rasulullah Sallallahu 'Alayhi Wasallam was sinless, he recited these types of du'aas (supplications) to express his humbleness and bond-manship. It is proper that a devoted worshipper asks only his creator, or this was done to educate the ummah. It is clear, from this hadith that Sayyidina Rasulullah Sallallahu 'Alayhi Wasallam slept on his right side. This was his noble practice. Therefore it is mustahab to sleep on the right side. A special benefit may be derived from this. The heart is on the left side of the chest, and by sleeping on the right side, the heart remains on the top side. One will not have a deep sleep, but will sleep lightly. If one sleeps on the left side, the heart will be at the bottom, which will result in a deep slumber. Some physicians have for this reason said, that it is good to sleep on the left side, because if one has a deep sleep, the food digest better. This is a fact. But there is a harm too, which has not be taken into consideration. If the heart is at the bottom, the weight of the whole body will be on it and this will affect it. The heart is one of the main organs of the body. Putting a little pressure on it may cause many diseases. Therefore, medically speaking, if it is good to sleep on the left, then too it is detrimental, from which one should at all times take precaution. In this respect, from the medical point of view it is important to sleep on the right side. Besides, sleeping on the right side reminds one of the grave. We have been commanded to remember death regularly. Many worldly and religious benefits are derived by constantly remembering death. One should constantly remember the breaker of all pleasures. The fact is this, how can one forget a thing that every being will experience which is sure to come and it is not known when it shall take place?