The film begins with a commercial from Lunar Industries. In the late 21st Century, Earth has had an energy crisis. Most coal, oil and natural gas reserves are nearly gone. Our new primary source of energy is Helium-3, which is found on the moon. Lunar Industries is responsible for the mining of Helium-3 and sending it back to Earth. We are then shown Lunar Industries Sarang Mining Base on the moon. There is only one person in the crew, and his contract is for three years. We are introduced to the employee, Sam Bell (Sam Rockwell). He has grown out his hair and has grown a beard during his time on the base. He puts on a spacesuit and goes outside, where he drives a land rover over to a Helium-3 harvester. He collects the Helium-3 and then sends it back to Earth using a rocket. We see how lonely Sam is when he continually talks to himself. Sam has video messages from his bosses and family, but he can't communicate with them via live feed, due to a satellite being jammed. Sam's only companion is GERTY (voice by Kevin Spacey), an intelligent robot who controls the base and looks after Sam.
As GERTY gives Sam a haircut, he asks him if everything's okay. He noticed that he's been acting unusual lately. Sam says that he's fine and then asks if anyone has fixed the satellite yet. GERTY informs him that its a low priority of the company. Even though he has two weeks left in his contract and will return to Earth soon, he thinks that it's fair for the satellite to be fixed for the person who will replace him. He also says that he has a headache. Afterward, he looks at an old video message sent by his wife, Tess (Dominque McElligott). She knows that he's lonely on the Moon's surface all by himself, but she's proud of what he's doing. She has their little daughter Eve say "astronaut." Sam passes the time by working on a miniature model of his hometown and watering his plants in the greenhouse. Sam watches an old TV show and then turns the TV off.
As Sam fills his glass with hot water, he hallucinates, seeing a woman in his seat. Distracted, Sam's hand gets burned by the hot water. GERTY bandages Sam's hand and asks him what happened. Sam says that he was distracted by the TV, but GERTY knows that he's lying since the TV was off when he came into the room. He says that maybe Sam is seeing things. Sam goes to sleep and dreams of being home with Tess. The next day, Sam wakes up and runs on a treadmill. He experiences some chest pains, but thinks nothing of it. GERTY makes Sam breakfast and cheers him up by reminding him that he has two weeks left. Sam is excited about going home. Sam puts on his spacesuit and uses the rover to go collect more Helium-3. On the drive though, Sam hallucinates about seeing the woman again and crashes the rover into a harvester. The atmosphere is compromised, so Sam puts on his helmet.
Sam wakes up in the infirmary. He looks fine but is too weak to move. GERTY has been monitoring his health and he asks Sam if he remembers anything from the crash. Sam doesn't, and GERTY tells him to go back to sleep. Sometime later, Sam starts to get frustrated about being kept in the infirmary since he feels better. GERTY says that he might have suffered from brain trauma and continues to conduct tests to make sure he's all right. Later on, Sam (healthy) gets up and walks around the base. He overhears GERTY talking to Lunar Industries via live feed. GERTY, realizing that Sam is nearby, shuts down the transmission. Sam asks him what's going on. GERTY says that he has informed Lunar Industries about the crash. They will be sending a rescue team to fix the harvester and then they will send Sam back to Earth. Sam says that he can fix the harvester himself and wants to go outside. GERTY has been given orders to keep Sam inside the base until the rescue team arrives. Sam also confronts GERTY about talking live to the company, but GERTY says that Sam is seeing things.
Sam feels like he's being treated like a child and grabs some tools. He opens a vent and cuts into a tube, causing a leak of gas to spray out. GERTY comes over and works on fixing it. Sam says that some meteorites might have caused the problem. He says that there might be a breach in the exterior shell of the base and that he should go inspect it. After some arguing, Sam tricks GERTY into letting him outside. Sam finds that his spacesuit is missing, and so he takes a spare one. He gets into another rover and drives out to the harvester where the crash occurred. The first rover is still there. Sam opens the hatch and finds a body inside. Upon further inspection, he sees that the body looks just like him but with bruises on his face. Sam brings the body back to the base. He asks GERTY what's going on and why the man looks like him. GERTY states that the man is Sam Bell.
(To make it clear, I'll refer to the bruised man as Sam 1 and the healthy man as Sam 2)
Sam 1 wakes up in the infirmary and we see that his hand is bandaged (making him the one we were introduced to before the crash). Sam 1 sees Sam 2 standing in the room. He asks GERTY who the other man is, but GERTY has Sam 1 go back to sleep. Later on, Sam 1 is well enough to walk around the base. There's some tension between the two Sams, with Sam 2 being the more aggressive one. Sam 1 tries talking to Sam 2, but he's more focused on working out. Sam 2 knows that they are clones of the real Sam Bell, which Sam 1 refuses to believe. Sam 1 asks GERTY if they are clones, but GERTY changes the subject. Sam 1 wants to shake Sam 2's hand since he's lonely and wants some human contact. Sam 2 snubs him, saying maybe later. Sam 1 tries to convince Sam 2 to relax by playing against each other in ping pong. Sam 1 easily beats Sam 2, causing him to lose his temper.
Sam 1 works on his miniature model of his hometown. Sam 2 asks him how long he's been working on it. Sam 1 says that the model was already started before he found it, and so he's been adding new buildings and people. Sam 2 takes this as further proof that they are clones, since someone else started the model and they share the same memories of the hometown. He says that there must be a hidden place somewhere on the base where Lunar Industries keeps the cloned bodies. Sam 1 thinks Sam 2 is crazy. Sam 2 starts to go throughout the base, searching for a secret room. He searches everywhere except for where the model is. He asks Sam 1 to move the model so that he can look beneath it. Sam 1 refuses. Things get physical, and Sam 2 becomes uncomfortable since Sam 1 is holding a small knife. They fight for control over the knife. Sam 2 beats up Sam 1 and destroys the model. He looks underneath it but finds nothing.
Sam 1 talks with GERTY about the other Sam. He's scared of him since he's got a short temper. He's also upset that the model is destroyed, since he spent a lot of time on it. GERTY reveals that both Sams are in fact clones. After the three year contract expires, a new Sam is awakened in the infirmary with implanted memories of Sam's family. They also have implanted memories of being on the base for a little while and being in an accident (to explain why they're in the infirmary). GERTY then conducts tests to evaluate their physical and mental states before they go to work. Sam 1 breaks down upon learning the truth. GERTY tries to comfort him, but he walks away in silence. Later on, Sam 2 tries to apologize to Sam 1, but he plays music and dances. Sam 2 realizes that GERTY was supposed to keep him from finding Sam 1. When the rescue team arrives, they will see them together and will be forced to kill them both. He also thinks that since the satellite is not being jammed from within the base, it must be caused by something outside. Sam 1 and Sam 2 get suited up and drive the rovers outside. They pass the perimeter of the base, which Sam 1 has never gone past before. They split up to look for anything unusual around. They each come to different towers that have been used to block live feed to the base. Sam 1 drops to his knees and vomits blood in his helmet. He goes back to the base and vomits more blood into the toilet. He also finds that a tooth has fallen out.
While Sam 2 continues to search for more towers, Sam 1 goes to the main computer of the base. He tries to access his contract, but his password is denied. GERTY enters the right password and Sam 1 reviews tapes from previous clones. It seems that at the end of each contract, the clone gets increasingly sick (bad coughs, hair falling out, etc.). Eventually each clone is put into a chamber, where they are told that they will be put in a cryogenic sleep before returning to Earth. However, all the clones are shown to die once their three years are over, being frozen, and then incinerated. Sam 1 goes to the room where the cryogenic chamber is and activates it. A recorded video from Lunar Industries plays, stating that the company is successful due to hard workers like Sam and they tell the clones to think of the work they've accomplished as they go to sleep. After the message, the chamber flashes brightly, incinerating everything inside. Sam 1 finds a hidden compartment in the room and breaks it open. Sam 2 comes back to the base, having found more towers outside the perimeter and writing down their coordinates. The two Sams enter the compartment and find that numerous clones are being kept there.
Sam 1 takes a portable video link and asks GERTY why he helped him before with the password. GERTY states that his main priority is Sam's well-being. Sam 1 suits up and goes outside again. Once he drives far past the towers, he calls his home. A teenager (Kaya Scodelario) answers and Sam 1 blocks the camera so that she can't see him. He asks if Tess Bell is there. The teen says that her mother Tess has been dead for a couple of years. Sam 1 realizes that he's talking to his daughter, Eve. He doesn't quite know what to say, and then he hears the real Sam Bell in the background (who has been alive and well on Earth). Sam 1 quickly hangs up and breaks down, wanting to go home. He goes back to the base, where Sam 2 is trying to make a shank out of wood (so that they can defend themselves against the rescue team). Sam 2 sees that Sam 1's health is deteriorating. Sam 1 says that he's freezing, and so Sam 2 helps him into bed. Sam 2 finds the video link in Sam 1's bag and replays the last call. He stops it in shock after hearing of Tess's death. Sam 2 tells GERTY that they've found the clone room, and he wants him to wake up another clone. GERTY refuses. Sam 2 makes him understand that when the rescue team gets there, they will kill him and Sam 1. Looking out for their well-being, GERTY complies with the request.
Sam 1 wakes up and finds an unconscious clone in the infirmary. Sam 2 informs Sam 1 that he has come up with a plan. The rescue team will be there within a few hours. They will expect to find a Sam inside the crashed rover. Sam 2 will kill the new clone (aka Sam 3) and then they will put his body in the rover. Since Sam 1 did his time, Sam 2 will put him in one of the rockets and send him back to Earth. Sam 2 will then act like he doesn't know anything and pretend that he's been inside the base the entire time. Sam 1 doesn't like the idea. He knows that they can't murder Sam 3 because they dont have it in them to kill. He also knows that he will die before reaching Earth. Sam 1 makes a change in the plan, he will be put back into the rover, Sam 2 will be sent home, and Sam 3 will remain on the base. Sam 1 tells Sam 2 to travel when he gets to Earth. Sam 2 thinks about going to Mexico or Hawaii.
Sam 2 and Sam 1 suit up and go out to the crashed rover. They talk fondly of Tess for a little while. Sam 2 carries the extremely weak Sam 1 back to the rover and places him inside. They say their goodbyes and Sam 2 closes the hatch. Sam 2 goes back to the base to find that the rescue crew will be there in minutes. He packs up some belongings and prepares to leave in the rocket when GERTY points out that the plan will not work. GERTY records everything once a clone wakes up in the infirmary. Lunar Industries can scan his memory and learn about the two clones interacting & their plan. Sam 2 will have to erase GERTY's memory. He tells GERTY that he will shut him down, and as soon as the rocket is fired he will be rebooted with a clean memory. He thanks GERTY and says goodbye before shutting him down. The rescue crew arrives, while at the same time Sam 2 rushes back to the main computer and enters a command. He then runs back to the rocket and is launched back to Earth. Sam 1 sees that Sam 2 was successful and dies inside the rover. The rescue crew finds the crashed rover and begins to work on the damaged harvester. GERTY is rebooted and tends to Sam 3, who has just woken up. We see that before Sam 2 left, the command he entered destroyed the towers outside the perimeter, allowing Sam 3 to have a live feed with Earth.
The film ends with Sam 2 traveling towards Earth. We hear a voice-over saying that Lunar Industries stock has dropped 32% so far as a result of the (presumed cloning) controversy that was leaked to the press, that Sam 2 is going to testify at a CAA board of directors hearing in Seattle, and then a goverment radio talk show host arguing that Sam 2 is either crazy, or an illegal immigrant, but either way should not be taken seriously.