Question: Can one pray while wearing pajamas?
Answer: In the previous Halacha we have established that before praying, one must prepare a fitting place, proper attire, and cleanse one’s body and thoughts, as the verse in the book of Amos states, “Prepare yourself before your G-d, Israel.”
Thus, the Rambam (Chapter 5 of Hilchot Tefillah, Halacha 5) writes that “one must prepare appropriate clothing first in order to glorify one’s self, as the verse states, ‘Bow to Hashem through glorious sanctity.’ One should not pray while wearing an apron” (which is not a garment one would wear when standing before an important official), for one must wear respectful clothing while praying.
It is therefore clear that a healthy individual should not pray while wearing pajamas, for one does not stand before even ordinary people while wearing pajamas and certainly not before important people. One praying must stand do so in respectable and glorified clothing just as the Rambam rules.
Regarding someone ill, we find that our Sages were lenient with regards to an ill individual, for instance, although one must pray while standing, Maran Ha’Shulchan Aruch (Chapter 94) rules that an ill person who cannot stand as a result of his weakness may pray while lying on his side. Based on this, Hagaon Harav Ovadia Hedaya zt”l writes in his Responsa Yaskil Avdi (Volume 8, glosses to Chapter 2) that the same applies regarding clothing and an ill individual need not change his clothing and he may pray in pajamas, as long as the pajamas are adequately clean.
Summary: One may not pray while wearing pajamas. An ill individual who has difficulty changing his clothes may pray while wearing pajamas as long as they are clean and unsoiled.
On a nostalgic note, during his final illness, although Maran Rabbeinu Ovadia Yosef zt”l suffered tremendous pain throughout his body, he exerted much effort with the minimal amount of strength he had to recite the Amida prayer while standing and while wearing respectable attire. In this way, he would stand and beseech Hashem on behalf of the entire Jewish nation until he unfortunately departed us for the Heavenly Yeshiva. May his soul be bound in the eternal bond and may we soon be reunited with him as we witness the Final Redemption and the Resurrection of the Dead, Amen.