The novel takes place in the "North American Confederation" of 1992, where civilians regularly travel to the Moon, and psi phenomena are common. The novel's protagonist, Joe Chip, is a debt-ridden technician for Glen Runciter's "prudence organization", which employs people with the ability to block psychic powers (like an anti-telepath, preventing a telepath from reading a mind) to help enforce privacy. Runciter runs the company with the assistance of his deceased wife Ella, who is kept in a state of "half-life", a form of cryonic suspension that gives the deceased limited consciousness and the ability to communicate.
When business magnate Stanton Mick hires Runciter’s company to secure his lunar facilities from telepaths, Runciter assembles a team of 11 agents. The group includes Pat Conley, a mysterious young woman who has the parapsychological ability to undo events by changing the past. Joe Chip and Pat have a repressed and distrustful sexual tension throughout the story.
When Runciter, Chip, and the others reach Mick’s moon base, they discover that the assignment is a trap, presumably set by the company’s main adversary, Ray Hollis, who leads an organization of psychics. A bomb explosion apparently kills Runciter without significantly harming the others. They rush back to Earth to place him in half-life.
Afterwards, the group begins to experience strange shifts in reality. Consumables, such as milk and cigarettes, begin to rapidly deteriorate. Also, the group sees Runciter's face on coins and receives strange messages from him. Most of these messages imply that Runciter is alive and that the rest of the group is in half-life, or "cold-pac" as it is informally called. Group members who separate from the others are found dead, in an advanced stage of decomposition.
The reality gradually shifts backward in time until the group finds itself in a world resembling the United States in 1939. Throughout, they try to deduce what is causing these strange occurrences, prevent each other from dying, and find a mysterious product called Ubik, which is advertised in every time period they enter. Messages from Runciter indicate that Ubik may be their only hope of survival.
Ultimately, Joe Chip learns that Runciter was, in fact, the sole survivor of the explosion on the moon, and the messages to the group are the result of his attempts to communicate with them while they are in half-life. The regressing world in which they find themselves is discovered to be the product of Jory Miller, another half-lifer whom Runciter encounters earlier in the story while communicating with Ella. It is revealed that Jory devours the life force of other people who are in suspended animation in order to prolong his own existence. Of the group of anti-psychics and technicians, only Joe Chip eludes him, aided by the product Ubik. Ubik, whose name is derived from the Latin word "ubique", meaning everywhere , can preserve people who are in half-life. Ubik was invented by a group of half-lifers, led by Ella Runciter, who developed it as protection from Jory. Joe Chip is instructed in its use by Ella, who is en route to a reincarnation.
In what he perceived as the "living" world, Glen Runciter encounters several coins showing Joe Chip's face, just as Joe and others first encountered coins with Runciter's. Runciter suspects that the new currency is "just the beginning," and the novel ends with the unresolved implication that Runciter himself may be dead after all.