Set months after the events of Spider-Man 2, Peter Parker has become a cultural phenomenon as Spider-Man, while Mary Jane Watson continues her Broadway career. Harry Osborn still seeks vengeance for his father's death, and an escaped Flint Marko falls into a particle accelerator and is transformed into a shape-shifting sand manipulator. An extraterrestrial symbiote crashes to Earth and bonds with Peter, influencing his behavior for the worst.
Development of Spider-Man 3 began immediately after the release of Spider-Man 2 for a 2007 release. During pre-production, Raimi originally wanted another villain to be included along with Sandman, but at the request of producer Avi Arad, the director added Venom and the producers also requested the addition of Gwen Stacy. Principal photography for the film began in January 2006, and took place in Los Angeles and Cleveland, before moving to New York City from May until July 2006. Additional pick-up shots were made after August and the film wrapped in October 2006. During post-production, Sony Pictures Imageworks created 900 visual effects shots.
Spider-Man 3 premiered on April 16, 2007 in Tokyo, and was released in the United States in both conventional and IMAX theaters on May 4, 2007. Unlike the predecessors, Spider-Man 3 received mixed reviews from critics, who felt it lacked a focused or substantial plot due to the excessive presence of characters from the comic books; however, it stands as the most financially successful film in the series worldwide, Marvel's third most financially successful film after The Avengers and Iron Man 3, and Sony Pictures Entertainment's second highest-grossing film behind Skyfall, despite being the most expensive film of all time at release (the record was surpassed just three weeks later by Pirates of the Caribbean: At World's End).
After the commercial success of Spider-Man 3, Raimi was scheduled to direct a fourth film. However, disagreements between Sony and Raimi forced the director to leave the project, and Sony canceled the film as a result. A reboot of the trilogy was released five years later.
Peter Parker plans to propose to Mary Jane Watson, who had just made her Broadway musical debut. A meteorite crashes near the two in Central Park, and an extraterrestrial symbiote attaches itself to Peter's moped. While fleeing police, escaped prisoner Flint Marko falls into a particle accelerator that fuses his body with surrounding sand, allowing him to shapeshift at will as the Sandman. Peter's best friend, Harry Osborn, who knows Peter is Spider-Man and blames him for his father's death, attacks Peter using weapons based on his father's Green Goblin technology. Harry injures his head and suffers partial amnesia, forgetting that Peter is Spider-Man and his desire for revenge. During a festival honoring Spider-Man, Marko robs an armored car. NYPD Captain George Stacy tells Peter and Aunt May that Marko was Uncle Ben's killer, and Dennis Carradine was only an accomplice. While a vengeful Peter sleeps, the symbiote bonds with him. Peter wakes up hanging from a skyscraper. His costume changes and his powers enhance, but the symbiote brings out Peter's dark side. Wearing the new black suit, Spider-Man locates Marko and battles him in a subway tunnel, reducing him to mud using water.
Mary Jane, whose career is floundering, is humiliated by Peter's changed personality and she finds solace with Harry. Urged on by a hallucination of his father, Harry regains his memory and blackmails Mary Jane to break up with Peter, threatening Peter's life. After Mary Jane tells Peter she is in love with another man (under Harry's direction), Harry meets with Peter and claims to be "the other guy". Later, Peter, wearing the black suit, confronts Harry and battles him. Harry throws a pumpkin bomb at Peter, who deflects it back, disfiguring Harry's face.
Under the symbiote's influence, Peter exposes Eddie Brock, a rival photographer at the Daily Bugle, by submitting doctored photographs showing Spider-Man as a criminal. Furious at having to print a retraction, J. Jonah Jameson dismisses Eddie. Meanwhile, the Sandman recovers from his injuries.
To make Mary Jane jealous, Peter brings Gwen Stacy, a woman Brock believes is his girlfriend, to the nightclub where Mary Jane works; Brock secretly sees them and assumes they are dating. Gwen catches on and storms out. Peter brawls with the bouncers and, after mistakenly hitting Mary Jane, realizes the symbiote is changing him. He retreats to a church bell tower. While trying to remove the symbiote costume, he hits the church's bell, weakening the alien and making it easier to remove. Peter tears the symbiote off and it falls to the lower tower, landing on Brock, who is praying for Peter's death. The symbiote transforms Brock into Venom, and while initially horrified, he gleefully accepts his new form. Venom finds the Sandman and offers to join forces, to which the Sandman agrees.
Mary Jane hails a taxicab but Brock hijacks it and hangs it and a dump truck from a web hundreds of feet above a sand-filled construction site. Peter seeks Harry's help but is rejected. A crowd of people watch as Peter battles Brock. Harry learns the truth about his father's death from his butler and goes to help Peter. Peter is eventually overwhelmed by the villains and is on the brink of being killed when Harry appears. Harry temporarily subdues a gigantic incarnation of the Sandman, breaking him apart. Brock webs Harry's glider, causing it to bump into some pipes, making sonic vibrations that weaken the symbiote. Peter recalls the church bells weakening it previously. Brock tries impaling Peter with Harry's glider, but Harry sacrifices himself by jumping in the way and getting himself fatally injured. Peter forms a ring of pipes around Venom, creating a wall of sonic vibrations. The alien releases Brock, and Peter pulls Brock away from the creature, which can now live on its own. Peter throws a pumpkin bomb from Harry's glider at the symbiote, but Brock, not wanting to lose his only chance of getting revenge, jumps into the symbiote and attempts to throw the bomb away and both are killed by the blast.
Marko reveals that he never intended to kill Ben, but only wanted his car and accidentally shot him when Dennis grabbed his arm, and says that Ben's death has haunted him since. Peter forgives Marko, who dissolves into sand and floats away. Peter and Harry forgive each other before Harry dies with Mary Jane and Peter at his side. Days later, Peter visits the jazz club where Mary Jane is singing, and they begin mending their relationship.
- Tobey Maguire as Peter Parker / Spider-Man: A superhero, a brilliant physics student at Columbia University, and photographer for the Daily Bugle.
- Kirsten Dunst as Mary Jane Watson: Peter Parker's girlfriend, whom he has loved since childhood.
- James Franco as Harry Osborn / New Goblin: The dedicated son of Norman Osborn, and Peter Parker's best friend, who believes Spider-Man murdered his father. After learning Peter is Spider-Man and his father was the Green Goblin, Harry becomes the New Goblin to battle Peter directly.
- Thomas Haden Church as Flint Marko / Sandman: A small-time thug with an estranged wife and sick daughter. He robs to get enough money to get his daughter treatment. He becomes the Sandman following a freak accident, and is hunted by Peter when he learns Marko was Uncle Ben's true killer.
- Topher Grace as Edward "Eddie" Brock, Jr. / Venom: Peter's rival at the Daily Bugle. He is exposed by Peter for creating a fake image of Spider-Man, and is ready for revenge when he bonds with the symbiote.
- Bryce Dallas Howard as Gwen Stacy: Peter's lab partner and good friend, who is also saved by Spider-Man.
- Rosemary Harris as May Parker: Peter Parker's aunt and widow of Ben Parker. She gives Peter her engagement ring so he can propose to Mary Jane, and teaches him forgiveness.
- J. K. Simmons as J. Jonah Jameson: The aggressive chief of the Daily Bugle. He despises Spider-Man.
- James Cromwell as Captain Stacy: Gwen's father and a New York City Police Department Captain.
- Theresa Russell as Emma Marko: wife of Flint.
- Dylan Baker as Dr. Curt Connors: Peter Parker's college physics professor. He examines a piece of the symbiote and tells Peter it "amplifies characteristics of its host… especially aggression."
- Bill Nunn as Joseph "Robbie" Robertson: A longtime employee at the Daily Bugle.
- Elizabeth Banks as Betty Brant: Receptionist at the Daily Bugle for J. Jonah Jameson.
- Ted Raimi as Hoffman
- Perla Haney-Jardine as Penny Marko: Flint and Emma's sick daughter.
- Willem Dafoe as Norman Osborn / Green Goblin: Harry Osborn's dead father returns as a hallucination to encourage his son to destroy Spider-Man.
- Cliff Robertson as Ben Parker: Peter Parker's deceased uncle.
- Elya Baskin as Dr. Ditkovitch: Peter's lanlord.
- Mageina Tovah as Ursula Ditkovich: An unassuming girl next door who is the daughter of Peter's landlord.
- Michael Papajohn as Dennis Carradine: The carjacker who was believed to have murdered Uncle Ben.
- Joe Manganiello as Flash Thompson: Mary Jane's boyfriend in the first Spider-Man movie, he reprises his role in a silent cameo where he attends Harry's funeral.