Castle is caught off guard when he gets home and finds Alexis playing laser tag. She is doing so without him, and with a guy named David. The young man is wearing Castle’s gear! As disconcerting as that is, Castle is even more thrown by the fact that Martha’s overnight guest, Ben, is wearing Castle's pajamas. Thankfully, there's been a totally out of this world murder to take his mind off his bustling home woes.
Tom Richwood was an astronaut who was killed during a simulation for a mission to Mars. Castle is blown away by the mission control setup. This private venture is being funded by Internet billionaire Viggo Jansen. Operations Director Ed Redley says that anyone needing to approach the body needs to wear spacesuits to access the area. Castle decides this is the best case ever.
Castle, Beckett and Esposito head into the simulation area. The bioscience officer says the victim was stabbed and one of his tools, a screwdriver, is missing. The four other astronauts were inside the module when the murder occurred. Viggo Jansen refuses to shut down his program, but will give the police full access to his simulator.
Tom Richwood’s video diary reveals that he thought he saw someone out there with him on Mars. The simulator’s security system was hacked by Clint Granger, a pilot who believes Tom Richwood stole his spot on the mission. He was ticked, but didn’t kill anyone. Someone is setting him up. It could be George Reyes, a senior facilities engineer.
Reyes had been acting strangely after receiving word from his wife, astronaut Angela Olvera, that their marriage was over. He didn’t kill Tom, but wanted to sabotage the mission. Reyes suggests there’s a way someone else could have gotten into the simulator. Castle and Beckett discover this to be the case as they find the murder weapon. They also find that they are not alone.
Castle and Beckett give chase to what looks to be an alien. Castle is bummed to learn that it was just someone in a gas mask. Evidence suggests it was Clint Granger. The gas mask is traced back to a place called Newton Endeavors. There’s a replica of Viggo Jansen’s space module at the headquarters. Billionaire playboy Sir Ian Rasher is funding this particular competitive program.
Granger admits spying for Sir Ian, but continues to deny killing Richwood. He was working with Jansen’s astronaut, Mikhail, who tries to flee from Esposito on the surface of Mars. He doesn’t get far. Mikhail admits he was trading information. He says nobody liked Tom Richwood. He also alibis out.
Castle realizes that the Rover may be responsible for Richwood’s death. Viggo Jansen talks with the simulator’s computer, MIRA, about the fact that the Rover wasn’t docked as initially reported. Something is off. MIRA is not following Jansen’s orders for a diagnostic check. The machine is lying. Someone told MIRA that Tom Richwood was a threat to the mission. When Jansen tries to reboot the system, MIRA responds with a vengeance.
Luckily, Beckett realizes they're on Earth, not Mars, and calls for help. She and Castle and Jansen are rescued from MIRA’s wrath. One of the other astronauts must have been the person who built a fail-safe into the computer to cover their tracks. But it turns out it was actually three of them conspiring to kill Richwood. Now, none of them are going to Mars. Instead, they're all on a one-way trip to prison.
With the case closed, Castle and Beckett discuss their mutual attempts to sign up for a chance to go to Mars. They ponder on how when people are stuck together in a small space for a long period of time there’s a tendency to lose perspective. As true as this may be, Castle is taken aback by Martha’s announcement that she’s looking to move out. It’ll be awfully quiet without her. Too quiet. Suddenly finding themselves in a much-too-quiet apartment, Castle and Beckett flee the loft in search of a loud restaurant, pronto.