Spider-Man 3 is a 2007 American superhero filmwritten and directed by Sam Raimi, with a screenplay by Ivan Raimi and Alvin Sargent. It is the third and final film in the Sam Raimi Spider-Man trilogy based on the fictional Marvel Comics character Spider-Man. The film stars Tobey Maguire, Kirsten Dunst, James Franco, Thomas Haden Church, Topher Grace, Bryce Dallas Howard, Rosemary Harris, J.K. Simmons and James Cromwell. The film begins with Peter Parker basking in his success as Spider-Man, while Mary Jane Watson continues her Broadway career. Harry Osborn still seeks vengeance for his father's death, and an escaped convict, 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 worse. When Peter abandons the symbiote, it finds refuge in Eddie Brock, a rival photographer, causing Peter to face his greatest challenge.
Spider-Man 3 was commercially released in multiple countries on May 1, 2007, and released in the United States in both conventional and IMAX theaters on May 4, 2007, by Columbia Pictures. Although the film received mixed reviews from critics, in contrast to the previous two films' highly positive reviews, it stands as the most successful film in the series worldwide, Marvel's most successful film, and Sony Pictures Entertainment's highest grossing film to date.
Peter Parker has begun to feel secure in his life and plans to propose to Mary Jane Watson, who has just recently made her Broadway musical debut. While Peter and Mary Jane are on a date, a small meteorite crashes nearby, and an extraterrestrial symbiote attaches itself to Peter's moped. Meanwhile, escaped convict Flint Marko falls into a pit of a particle accelerator that fuses his body with the surrounding sand. The result allows him to shapeshift at will, becoming the Sandman. Peter's best friend, Harry Osborn, who seeks vengeance for his father's death, which he believes Peter caused, attacks him using new weapons adapted from the Green Goblin technology his father had left behind. During the scuffle, Harry injures his head and suffers from partial amnesia, making him forget his feud and the fact that Peter is Spider-Man.
Later, during a festival honoring Spider-Man for saving Gwen Stacy's life, Sandman attempts to rob an armored car, and overpowers Spider-Man. NYPD Captain George Stacy (Gwen's father) later informs Peter and Aunt May that Ben Parker's killer was actually Flint Marko, and that the now-deceased carjacker was merely an accomplice. A vengeful Peter waits for Marko to strike again as the symbiote bonds with his costume while he is asleep. Peter wakes up hanging from a skyscraper in central Manhattan and discovers that not only has his costume changed, but his powers have been enhanced as well. The symbiotic black suit brings out the more vengeful, selfish and arrogant side of Peter's personality. Wearing the new suit, Peter locates Marko, fights him in a cavernous underground subway tunnel and, upon discovering that water can dissolve Marko's body, rips open a large water pipe to deliver what he believes to be a lethal torrent of water, reducing the Sandman to mud.
The shift in Peter's personality alienates Mary Jane, whose career is floundering, and she finds solace with Harry. Harry recovers from his amnesia and, urged on by an apparition of his dead father, forces Mary Jane to break up with Peter. After Mary Jane leaves Peter, stating she is in love with another guy, Harry meets him at a restaurant and claims to be the other guy. Later, Peter confronts him at the Osborn mansion. With the help of the black suit, Peter is victorious in a brutal fight, which leaves Harry's face disfigured due to an explosion of one of Harry's pumpkin bombs. Influenced by the suit, Peter exposes and humiliates Eddie Brock, a rival freelance photographer, who has just gained overnight star status at the Daily Bugle by submitting doctored photographs supposedly exposing Spider-Man as a criminal; J. Jonah Jameson fires Eddie. Peter changes how he dresses and alters his hairstyle and begins to behave arrogantly. Meanwhile, the Sandman recovers from his injuries, having survived Spider-Man's attack.
In an effort to make Mary Jane jealous, Peter brings Gwen to the nightclub where Mary Jane works. He gets into a fight with the club's bouncers and unintentionally shoves Mary Jane, knocking her to the floor. Peter realizes the symbiote is changing him for the worse. He walks out of the nightclub and goes to a church bell tower to dispose of it. Initially, he is unable to remove the suit, but the alien eventually weakens due to the loud sounds of the bell, enabling Peter to break free. Eddie Brock, by chance, is at the same church praying for Peter's death when the symbiote falls from the tower and takes over his body. Eddie, now reincarnated as Venom, finds the Sandman and suggests joining forces to destroy Spider-Man, to which the Sandman agrees.
The pair put Mary Jane in a taxicab and hang it from a gigantic web above a construction site filled with sand. Peter approaches Harry for help, but is turned down. However, Harry learns the truth about his father's death from his butler Bernard, and arrives in time to rescue Peter; they form an alliance against the two villains. As the fight progresses, Harry temporarily subdues a gigantic, monstrous incarnation of the Sandman, and Venom attempts to impale Peter with Harry's glider, but Harry jumps in the way and is mortally wounded, suffering the same fate as his father. During his fight with Venom, Peter notices that falling lengths of pipe appear to distress the symbiote, and Peter recalls how the church bell's toll weakened it, and creates a ring of several pipes around Venom to make a "fence" of sonic vibrations. The alien succumbs to so much pain that it releases Brock, and Peter pulls Eddie away from it with a string of web. Peter throws one of Harry's pumpkin bombs at the symbiote, but Eddie jumps into the ring in an attempt to rebond with it; he and the symbiote are killed by the explosion.
After the battle, Marko recovers and tells Peter that he had no intention of killing Ben Parker (but rather fired his gun as a reflexive reaction when the other carjacker grabbed his arm), and that it was an accident born out of a desperate attempt to save his dying daughter's life. He claims that Ben Parker's death has haunted him ever since then. Peter forgives Marko, who dissipates and floats away. Peter and Harry forgive each other before Harry dies with Mary Jane and Peter at his side. Later, Peter walks into the jazz bar where Mary Jane is singing. They embrace and begin to dance.