James Bond (Roger Moore) is sent to Siberia to locate the body of 003 and to recover a microchip. Upon doing so, he is ambushed by Soviet troops but flees in a submarine built to resemble an iceberg.
After Bond returns to England a week later, Q (Desmond Llewelyn) has the microchip analysed and informs M (Robert Brown), Bond and the Minister of Defense that its design is an exact match of a microchip made by Zorin Industries. The retrieved microchip is also designed to withstand the damage caused to other chips by the electromagnetic pulse of a nuclear explosion.
Bond and his superiors visit the Ascot Racecourse to observe the company's founder and CEO, Max Zorin (Christopher Walken). While at the track, Zorin's horse Pegasus miraculously pulls ahead to win the race. Later, Pegasus throws a fit and it takes some effort to get him under control.
Sir Godfrey Tibbett (Patrick Macnee), an MI6 agent who works as a horse trainer, believes Zorin's horse was given drugs, although when screened by officials prior to the race, it did not show any drugs in its bloodstream. Through Tibbett, Bond meets a French private detective named Achille Aubergine (Jean Rougerie) at the restaurant on the Eiffel Tower to discuss how the horse may have won. Aubergine informs Bond that Zorin is holding an annual horse sale later in the month. Moments later, Aubergine is assassinated by Zorin's mysterious bodyguard, May Day (Grace Jones). Bond chases her to an upper level of the tower but she parachutes off before he can catch her. Bond steals a Renault taxi and chases her through the city but is unable to apprehend her. A boat driven by Zorin later picks her up on the Seine.
Bond and Tibbett travel to Chantilly, France where Bond poses as James St. John Smythe (pronounced "sin-jin-smythe"), a rich dilettante who recently inherited horses, with Tibbett posing as his valet. During a reception party, they meet Zorin's head of security, Scarpine (Patrick Bauchau), and an American named Stacey Sutton (Tanya Roberts). Bond thinks the woman "bares closer inspection," but Tibbett reminds him of their primary mission. Bond uses polarizing sunglasses provided by Q to discreetly survey Zorin's mansion, discovering Zorin's secret lab. Bond and Tibbett break into the lab and discover the secret: Zorin plants microchips in his horses, programmed to release a steroid when prompted by a hidden radio transmitter snuck into the tip of the jockey's whip. Bond eludes Scarpine and retreats to May Day's room. He asks May Day to join him in bed and she does so with Zorin's amused permission.
Their intrusion is discovered and Zorin asks Bond to report to his study, where he'll aid St. John Smythe in selecting a stud horse for the stables he supposedly inherited. During their meeting, Zorin uses a database to find a match for pictures he takes of Bond; Zorin discovers Bond's real identity. He invites Bond to race with him steeplechase-style. In an effort to get rid of Bond, he provides Bond with an ill-tempered horse; when Bond overtakes Zorin, Zorin activates a device that causes the horse to go wild. Bond escapes the track and sees his limousine, boarding it. However, Tibbett has been killed by May Day, who is driving the car. She and Zorin attempt to drown Bond in a nearby pond but the plan fails. Later, General Gogol (Walter Gotell) from the Soviet Union visits Zorin's estate with several other KGB agents. Zorin, it is revealed, has been in the employ of the KGB and is admonished by Gogol for his public image and attention-garnering business ventures. Zorin replies by saying he no longer sees the need to continue doing business with the KGB. When Gogol's assistant chides Zorin for being a "physiological freak" Mayday grabs the man and throws him. Gogol gravelly warns Zorin "no one leaves the KGB," but grudgingly leaves when Zorin's men pull guns on him.
Later, in an airship over San Francisco, Zorin unveils to a group of investors his new criminal scheme to destroy Silicon Valley in an operation he dubs "Main Strike", which if implemented will gain them a monopoly in the microchip market. For involvement in the plan, Zorin demands $100 million from each participant in addition to a contract promising half of their net income through marketing deals. One man refuses and is dropped out of the airship by May Day, landing in San Francisco Bay.
Meeting in San Francisco with his CIA contact, Bond learns that Zorin is a psychopath, the product of Nazi medical experimentation during World War II by Zorin's mentor, Dr. Carl Mortner (Willoughby Gray), who is revealed to be a former Nazi doctor named Dr. Hans Glaub. Bond assumes the identity of a reporter for the London Financial Times to continue his investigation. Bond learns from a local crab fisherman that a prolific crab patch has vanished near one of Zorin's oil pumping stations. Bond also learns from the mayor that Zorin has been testing his oil lines for leaks with seawater, an explanation for the disappearing crab stock.
007 spies on an oil rig owned by Zorin. He catches KGB agent Pola Ivanova trying to blow up the rig, while recording Zorin announcing his plans. Bond meets Stacey again, and he learns that her grandfather's oil company had been taken over by Zorin. The two team up to steal documents about his plan from the San Francisco City Hall. Zorin arrives, holding them hostage, and then forces a city official to call the police. He kills the official with Bond's Walther PPK pistol and sets the building on fire in order to frame Bond for the murder. Bond and Sutton escape from the fire but when the police try to arrest Bond, they escape in a fire engine. A chase ensues, during which multiple SFPD cruisers are wrecked. Bond and Sutton then manage to shake the police off completely when the police captain leading the chase orders a bridge operator to open the Third Street Drawbridge. Bond and Sutton's fire truck makes it across just as the bridge gates close to stop traffic and the bridge begins to rise. The police cars are unable to stop in time and pile up at the bottom of the bridge. The senior officer is berating his underlings when his own car is crushed by the bridge's counterweight.
The next day, Bond and Sutton infiltrate Zorin's mine near Silicon Valley, discovering his plot to detonate explosives beneath the lakes along the Hayward Fault and the San Andreas Fault causing them to flood, submerging Silicon Valley. The resulting disaster will make Zorin the sole manufacturer of microchips in the world. A larger bomb is also on site in the mine to destroy a "geological lock" that is in place to prevent the two faults from moving at the same time. Once destroyed, it would supposedly cause a double earthquake. Zorin and Scarpine flood the mines, nearly killing Bond and May Day and murder all of the mine workers as they attempt to flee. Stacey manages to escape. Because she was betrayed, May Day helps Bond remove the larger bomb that would destroy the lock. They put the bomb on a handcar and push it out of the mine along a railroad line. May Day stays on the car to hold the faulty brake lever, sacrificing her own life as the bomb explodes outside, away from the lock.
Sutton is quickly captured by a devastated Zorin, who is escaping via airship with Scarpine and Mortner. Bond grabs hold of the mooring rope and clings on as the airship ascends. Zorin tries to kill Bond by flying him into the Golden Gate Bridge, but Bond manages to moor the airship to the bridge framework, stopping it from moving. Stacey attacks Zorin and in the ensuing fracas, Mortner and Scarpine are temporarily knocked out. Stacey flees onto the bridge and joins with Bond, but Zorin comes after them with an axe and engages in a fierce battle with Bond. Bond gains the upper hand and sends Zorin plummeting off the bridge to his death. An enraged Mortner attempts to kill Bond with a bundle of dynamite, but Bond slashes the mooring rope, causing Mortner to drop the dynamite into the cabin. Seconds later, the dynamite explodes and destroys the airship, killing Mortner and Scarpine.
In the aftermath, Bond is ironically awarded the Order of Lenin by General Gogol. Q, inside a special van in California, uses his fake-dog surveillance camera to locate 007. He safely finds him making love to Stacey in her shower.