The best tales of the supernatural, from Mary Shelley’s Frankenstein to the television series Buffy the Vampire Slayer, use fantasy to dramatize emotions that are too dark and overpowering to be treated conventionally. Sam Raimi’s marvelous Spider-Man 2 takes audiences into some pretty deep waters too. It’s about Peter Parker’s guilt over not being able to prevent the killing of his uncle (in the first Spider-Man picture). It’s also about the way his secret identity as Spider-Man and his love for M. J. Watson pull him in opposite directions. (Tobey Maguire and Kirsten Dunst pick up the roles they created in Spider-Man.) These conflicts cripple him: at crucial moments, he finds his supernatural gifts have deserted him.

The villain of the film is Dr. Otto Octavius (Alfred Molina), a brilliant physicist who has developed a way to harness power through four electrified metallic limbs inserted painfully into his spinal column. When his ambition reaches megalomaniacal and hubristic extremes, however, the limbs fuse to his body and begin to control him. Peter’s best friend, Harry Osborn (James Franco), who is obsessed with the death—at Spider-Man’s hands—of the father he could never please, has become a corporate phony, a baby-faced version of his tyrant dad, and the financial enabler of Octavius’s research.

In the first Spider-Man, Raimi focused on the characters (and especially the love story); the special effects were modest. In Spider-Man 2, he doesn’t choose one over the other. The set-piece scenes, like one in which Spidey has to stop a speeding train from plummeting into the river, are gripping. The grandeur of the images derives as much from their significance for the characters as from Raimi’s visual imagination. When Octavius skitters up the side of a building, his appendages slithering menacingly through the air like horrific emanations of his worst impulses, he looks like a nightmare version of Spidey scaling the heights. Hero and villain are grotesque mirror images of each other, like Batman and Joker.

A shot of M. J. shinnying down a glistening web after Spider-Man has revealed his true feelings for her is beautiful enough to draw tears. And there’s a plaintive moment when Peter, struggling to adjust to life without M. J., disappears down a street plastered with close-ups of her face. (She’s a model in a perfume ad.)

Raimi builds in a motif of shattered glass. It makes potent sense: both Octavius and Harry are bedeviled by false reflections. Octavius’s obsession is also the literal cause of the death of his wife (Donna Murphy): when his experiment veers out of control, crumpling the laboratory Harry has built for him, she’s pierced by a shard of window glass. Harry’s obsession leads him to confront, in his own mind, the ghost of his father (Willem Dafoe), in a sequence that seems to climax with Harry’s smashing through the glass.

Franco is terrific as Harry, and the performances of Maguire and Dunst surpass the high expectations created by the first film. Sometimes Alvin Sargent’s dialogue is overly bold, spelling out the feelings of the characters in block letters like the ballooned dialogue in a comic strip. The script is stronger on concept and narrative than on dialogue, but Raimi, using the close-up like the best silent-movie directors, gets a complex of emotions out of his two stars.

In their first scene alone together, when she lingers after his birthday party, you read on their faces every unexpressed romantic feeling from enchantment to desperation. And Maguire has an amazing scene with the sublime Rosemary Harris, playing Aunt May, when he works up the courage to confess his role in his uncle’s death.

In every way Spider-Man 2 expands and deepens the experience of the first movie. Like Peter, who finally seizes the freedom to fly without a mask, it takes risks that pay off.