I have been wondering about the interpretation of scholars regarding praying in an environment rather then earth. For example today there already astronauts living on the space station for months. Or in the not far future it seems that people would be able to travel or maybe establish colonies in mars. How would they pray under these conditions? I want focus on issues like direction, how to perform praying rituals under lack or low gravity force, the time of pray etc.
Well I have found this Hadith related to your question. It may be answer you want.
حَدَّثَنَا أَبُو نُعَيْمٍ، قَالَ حَدَّثَنَا شَيْبَانُ، عَنْ يَحْيَى، عَنْ مُحَمَّدِ بْنِ عَبْدِ الرَّحْمَنِ، أَنَّ جَابِرَ بْنَ عَبْدِ اللَّهِ، أَخْبَرَهُ أَنَّ النَّبِيَّ صلى الله عليه وسلم كَانَ يُصَلِّي التَّطَوُّعَ وَهْوَ رَاكِبٌ فِي غَيْرِ الْقِبْلَةِ.
Meaning : The Prophet (ﷺ) used to offer the Nawafil, while riding, facing a direction other than that of the Qibla. Source
An astronauts can't really know time while in space and direction too so if you don't know the direction, you can offer pray in any direction by using local time.
We don't have to wonder about this, because there have been many muslims in space, and the first Sultan bin Salman Al Saud (who incidentally is also the first royal, arab and the youngest person ever in space), gave an interview to NPR in 2011 on his experience:
MARTIN: One of the aspects of space travel that I think people find fascinating is how astronauts cope with the routines of daily life, be it eating or brushing their teeth. And traditionally, Muslims are required to pray five times a day. How did you address this responsibility while in space?
SAUD: Very easily. Because we have been acclimated, whether from a religious point of view or whether from just a personal point of view, I myself have grown up in the central part of Arabia, and we're surrounded by great deserts. And, of course, I'm a diver also at the same time. And I'm a flyer and I'm a glider pilot. And in doing all these things at the same time, they become natural when you work on them and practice them.
We never really saw Islam or religious duties as being something out of the ordinary. I remember, you know, whether we're flying or in different places - as a Muslim, you can pray anytime. You can face any direction. Like, in the space shuttle, you know, we can't really face to Mecca, although we're flying east, because we're flying at such a great speed. Like I said, those days, by the time you face Mecca, you probably already passed it.
(SOUNDBITE OF LAUGHTER)
SAUD: So, you know, in fact, also...
MARTIN: So what did you do? Just stop or - how did you manage it? You couldn't have a rug, I presume. You couldn't have a prayer rug.
SAUD: No rug. No magic flying rugs.
SAUD: But, you know, I had to strap my feet so I can kneel. You know, you can't kneel fully because lack of lack of gravity, actually. But, you know, I prayed like a traveler. As travelers, we pray three times a day, not five times a day. And I prayed according to Florida time, when we launched. And, in fact, it was the end of the fasting month, which is approaching now, as you know, in about three weeks.
And we did fast the whole month of Ramadan in Houston, on Clear Lake. And we - in fact, the NASA people were very kind enough to say if we wanted to adjust our program to start a bit later, and wee said we'll start exactly the same time we started every day, which is about 6:30, 7:00 in the morning. It was hot in the summer those days, like these days, and we went on through the day. And I'd need no more than five or six hours of sleep, and we were never the healthiest. So the last day of the mission was actually the last day of Ramadan, or so. So I also was the first person to fast a day of the month of Ramadan in space.
In my opinion, if you know the direction of earth, then that is where you should face, because, we pray in the direction of the Kaaba, and the Kaaba is the centre of earth. So, as long as you are facing earth from outer space, then you are facing the Kaaba. But that is just my own personal opinion. Allahu Aalam.