Shekhar Subramanium (Khan), a game designer who works for the London-based Barron Industries, has delivered a number of commercial failures; an irate Barron (Tahil) gives him his last chance to develop a successful game. To impress his sceptical son Prateek (Verma), and upon the request of his wife Sonia (Kapoor), Shekhar uses his son's idea that the antagonist should be more powerful than the protagonist.
His colleague, computer programmer Jenny (Goswami), uses Shekhar's face as a model for that of the game's protagonist G.One (Good One), while the shape-shifting antagonist Ra.One (Random Access Version One) is made faceless. Another colleague, Akashi (Wu), implements the characters' movements. The game, named Ra.One, contains three levels, the final level being the only one in which either character can be killed. Each character possesses a special device – the H.A.R.T (Hertz Amplifying Resonance Transmitter) which gives them their powers. Upon reaching the last level, the characters gain a gun with one bullet; the other character can be killed by this bullet but only if his H.A.R.T is attached.
When Ra.One undergoes final tests, Akashi notices unusual glitches but chooses to ignore them. When the game is officially launched, it receives a standing ovation from the audience; an enamored Prateek insists on playing it immediately. He logs in under the ID Lucifer and proceeds to the second level, but is interrupted by Akashi. Ra.One, unable to end his turn with Lucifer and angry that a player has proceeded so far, becomes determined that Lucifer will die. He uses a wireless technology (which Jenny had introduced in a conference) to enter the real world, a process which causes the mainframe to malfunction. Akashi informs Shekhar, who partially understands the situation and rushes home, fearing for his son's life. Meanwhile, Ra.One kills Akashi and assumes his form; he goes to find Lucifer, and meets Shekhar in the process.
In an attempt to save his son, Shekhar claims that he is Lucifer, but his lie is exposed when Ra.One scans his identity card. Consequently, Ra.One kills Shekhar and makes it look like a car accident. Sonia, devastated after Shekhar's death, tells Prateek that the family will return to India after Shekhar's funeral.
A suspicious Prateek notices digital patterns on the fateful road and realises that Ra.One has come to life. He convinces Jenny of the same when they see the destroyed game laboratory, and the latter tries to bring G.One into the real world. Meanwhile, Ra.One chases the family on their way to the airport, but G.One enters the real world and causes a gas explosion which temporarily destroys Ra.One. G.One takes Ra.One's H.A.R.T. and accompanies the family to Mumbai after Sonia realises that she needs him.
Subsequently, Ra.One returns to life, takes the form of a billboard model (Rampal), and tracks down G.One to Prateek's birthday party. Hypnotizing Sonia, he assumes her form to kidnap Prateek. Ra.One then instructs G.One to give him his H.A.R.T. back, and sends the real Sonia in a malfunctioning local train. The train crashes into the Chatrapati Shivaji Terminus, but G.One saves Sonia in time. To save Prateek, he returns to the virtual world and fights Ra.One; both reach the third level, the former left with little power. G.One tricks Ra.One into shooting him without his H.A.R.T. attached, leaving Ra.One helpless; furious, the latter creates ten copies of himself. Prateek, unable to identify the real Ra.One, asks G.One to quote Shekhar: "If you join the forces of evil, its shadows shall always follow you".
The pair realise that only one of the ten Ra.Ones has a shadow: the original one. G.One shoots and destroys him, absorbs Ra.One's remains and disappears. Six months later, Prateek and Sonia return to London, where the former manages to restore G.One to the real world.