Source Material: Philip K. Dick’s “We Can Remember It for You Wholesale” (1966)
In the movie: Inexplicably ripped construction worker Douglas Quaid dreams — both literally and figuratively — about Mars. Against the advice of his buddy, he visits Rekall, where he purchases implants that will give him all the memories of his ideal Mars vacation. Unfortunately, the process reveals that Quaid’s simple life was a lie: he’s a former secret agent whose memory had been wiped, and his wife is just another agent tasked with making sure he doesn’t remember who he truly is. He makes his way to Mars, where he hooks up with the resistance against the ruthless Martian governor Vilos Cohaagen and discovers his mind holds the secrets to an ancient Martian machine that could reshape the red planet. Or, just possibly, he never woke up at Rekall and everything is unfolding in his head while he’s a vegetable in the real world.
But in the book: Douglas Quail is no musclebound he-man, but rather just an average joe who works as a clerk. Like Quaid, Quail fantasizes about a Mars vacation, so he visits REKAL to get an “extra-factual memory” of an adventure on Mars as a spy. As in the film, the REKAL workers freak out when they uncover his real memories, so they erase the memory of his REKAL visit and send him home. Soon enough, however, a pair of cops show up and try to murder Quail. See, he’s got a device in his noggin that allows his former bosses to read his thoughts, and they don’t want his memories coming back.
And here’s where Paul Verhoeven’s film and Dick’s story part ways. Quail never visits Mars, there’s no twist about him being a double agent, and there’s no ancient alien technology for him to unlock. Instead of going on the run, Quail cuts a deal where REKAL will re-erase the memories of his Mars mission, as well as tweaking his brain in such a way that he’ll never have any desire to return to REKAL. But here’s where things get weird: his new memories, rather than just returning to him the boring life he thought he had, convince him that he was visited by aliens as a child, and that his continuing survival is the only thing standing between mankind and an extraterrestrial invasion. But, just as happened before, as they are preparing to implant the fake memories, it is suggested that those memories are real too. Which, yeah, is a bit out of nowhere compared to the film’s more elegantly ambiguous ending.