“Spider-Man” is probably the best superhero movie ever made. It has the right blend of action, humor and humanity, an appropriately insane villain, and a hero whose motivations are simple but whose character is complex.

Sam Raimi (“Army of Darkness,” “A Simple Plan”) lobbied for a chance to direct the film, and thank goodness he got it. He can create moments of humor and moments of darkness with equal agility, and he can mix them better than almost anyone. He is respectful of the source material but doesn’t take it so seriously that it impairs his own vision. His “Spider-Man” movie is what the comic book has deserved for 40 years.

The first half of the film is essentially the first issue of the comic book. Peter Parker (Tobey Maguire) is a somewhat geeky high school senior who gets bitten by a radioactive, genetically altered “super spider,” granting him the relative powers of that spider. Now he can jump, sense danger, stick to walls, and even spin webs. (The film’s one major departure from the comic is that rather than Peter using his nerd knowledge to make artificial webs, his body produces them naturally.)

This is where the humanity of the film kicks in. Superman was an alien whose powers developed when he was an infant. Batman was a millionaire who brooded in darkness. Spider-Man is a hormonal teen-ager who wants to impress pretty Mary Jane Watson (Kirsten Dunst), please his kindly old Aunt May (an occasionally too-overwrought Rosemary Harris) and Uncle Ben (Cliff Robertson), and maybe one day become a professional photographer. His powers bring him surprise, fear and delight. He has no idea what’s going on.

Fans know what happens next: Someone Peter loves is killed by a villain whom Peter could have stopped in a previous encounter. Watch the vengeance in his face as he embarks on his first crime-fighting web-swing across New York to catch the murderer. The visual effects are fantastic here — in other scenes, they sometimes are too special-effecty — but Peter’s personal reasons for the chase infuse the scene with incredible energy and emotion. In this moment, he’s not out to fight for truth, justice and the American way. He wants to catch the scumbag who killed someone close to him — and we’re with him all the way.

The whole movie is like that, making us sympathize with the good guys, and occasionally even with the primary bad guy. That would be the Green Goblin, whose real-life identity is millionaire Norman Osborn (Willem Dafoe), father of Peter’s best friend Harry (James Franco). It is the Green Goblin (who looks a little too ridiculous, I think) who utters the film’s most comic-bookish lines, statements like, “We’ll meet again, Spider-Man!” and “You’ve spun your last web!”

Which brings us to another great thing about the film, which is that it’s not afraid of the fact that it’s based on a comic book. The lines just quoted are cheesy, but they’re cackled without self-consciousness. No explanation is given as to how Peter manufactures his sleek, form-fitting costume. And since when does being bitten by something give you the powers of whatever bit you? It doesn’t matter. As down-to-earth as our hero is, his story is still beyond reality. What’s surprising is how well the two conflicting attitudes blend into one fantastical, believable story.

So many deft touches, so little space to discuss them. The fast-moving script by David Koepp (“Panic Room,” “Jurassic Park III”). The musical score by Danny Elfman (the only man who should be allowed to score this sort of movie). J.K. Simmons’ film-stealing turn as blustery, tyrannical newspaper editor J. Jonah Jameson. Peter coming to understand the gravity of Uncle Ben’s statement that “with great power comes great responsibility.” The heartbreaking Mary Jane Watson moving from one bad situation to another, finding joy only in her occasional interactions with Spider-Man.

And, most exciting, watching them set the stage for sequels.

A- (2 hrs., 2 min.; PG-13, very mild profanity, a lot of action violence, some of it fairly intense.)