Dominic Gorie, commander of March's STS-123 flight, and Mike Foreman, mission specialist No. 2 on the flight, attended batting practice prior to Tuesday's game against the Giants.
The two men presented first baseman Lance Berkman with his own jersey, which they took with them to the International Space Station in March.
They also showed Berkman a picture they took from space.
"Unless you've been in space or been associated with the people that have been there, it's really hard to wrap your mind around the concept of being up there," Berkman said. "Just looking at the picture, it's really cool. It's an honor that they choose my jersey."
Berkman's jersey spent 14 days on the space station and saw a lot of action.
"We took it out of the locker and wore it, had some fun with it up there a little bit," Foreman said. "Did some head-first slides. You slide a lot farther than he can down here because there's less gravity to deal with."
Both astronauts took swings in the batting cage, getting some instruction from the players and hitting coaches.
Foreman, a native of Cleveland, said he is a die-hard Astros fan and a season-ticket holder.
"It's pretty unique to have a job that has the same title as the team we're here watching and that we watch on TV," Gorie said. "It's a great testament to the significance of what NASA does. They've got a great team and we've got a great space program, so it's an awesome opportunity to come to the ballpark."
Earlier in the season, the Astros celebrated NASA's 50th anniversary by wearing a commemorative patch on their jerseys and by hosting the crew of STS-126.
Krysten Oliphant is an associate reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.