A few weeks ago, Josh Whedon helped redefine the entire horror movie genre, with the nefariously clever “Cabin in the Woods.” Today, he has kick-started the summer movie season with the witty, giddily explosive thrills of “The Avengers” … while deftly avoiding the many pitfalls that could have derailed this Summit Meeting of Superheroes.

The biggest challenge comes from stage-managing the antics of half a dozen dynamic Marvel Comics icons, four of whom — Iron Man, Thor, Captain America and the Hulk — already have their own popular film franchises, complete with established villains, supporting players and running plotlines.

This puts considerable pressure on the need to properly showcase each character, while preserving the existing narrative threads and granting sufficient exposure to the comparative newcomers — Hawkeye and the Black Widow — and the “guy in charge” (Nick Fury).

Whedon and co-scripter Zak Penn have done a marvelous job, with a sharp, savvy screenplay that lives up to — and surpasses — expectation.

The core plot is easy to digest, with the usual arrogant villain who intends to enslave our planet with the assistance of an armada of nasty, deep-space aliens; while the peril is serious, the action allows for plenty of snarky dialogue and the occasional droll sight-gag (as with, in one quick scene, the Hulk’s rather abrupt dismissal of Thor).

At the same time, Whedon isn’t afraid to show some teeth; the eyebrow-raising, Manhattan-devastating carnage includes some grim tidings. Let us not forget that a few beloved “Firefly” characters perished in the big-screen sequel, “Serenity,” much to the lamentations of that show’s fans.

Attentive superhero buffs have been prepped for this film since the post-credits tag scene that concluded 2008’s “Iron Man,” when the uber-mysterious Nick Fury (Samuel L. Jackson) tantalized Tony Stark (Robert Downey Jr.) with a project known as “The Avenger Initiative.” Subsequent hints were dropped in the final moments of “The Hulk,” “Captain America” and “Iron Man 2,” while the core plotline — involving the glowing blue cube known as the tesseract — received early exposure at the end of last year’s “Thor,” when Fury revealed this cosmic artifact to an intrigued Professor Selvig (Stellan Skarsgård), who appeared to be under the influence of the Asgardian god’s evil half-brother, Loki (Tom Hiddleston).

In between films, the tesseract has been examined and probed by Fury and his research scientists of SHIELD — the Strategic Homeland Intervention, Enforcement and Logistics Division — the ultimate U.S. good-guy black-ops organization. Fury and his ubiquitous sidekick, the drolly straight-faced Agent Coulson (Clark Gregg), have been hoping to exploit the tesseract’s power in order to beef up Earth’s defenses, given the ever-more-dire celestial menaces that have been popping up.

“The Avengers” begins as Loki, granted additional cosmic powers by the lizard-like Chittauri, a deep-space warrior race, blasts his way into SHIELD headquarters and steals the tesseract. He also absconds with Selvig and SHIELD’s high-tech, bow-and-arrow-wielding sentinel, Hawkeye (Jeremy Renner), having subverted both their wills and turned them into acolytes.

With Thor (Chris Hemsworth) off-world and therefore unable to deal with Loki, Fury and Coulson activate the Avenger Initiative. SHIELD operative Natasha Romanoff (Scarlett Johansson, appropriately sultry), better known as the Black Widow, is sent to fetch Bruce Banner (Mark Ruffalo, taking over from Edward Norton), who has been keeping a low profile as a field doctor caring for the poor. Natasha insists that Fury wants Banner only for his research expertise — and not for the uncontrollable rage demon that lurks within, like a giant green Mr. Hyde — but the good doctor sadly suspects otherwise.

Ruffalo smoothly elicits our compassion for Banner, as the pluperfect tortured soul: a well-meaning scientist who spends every waking moment trying to remain calm, lest he unleash the beast within. Ruffalo is far more vulnerable and sympathetic than Norton’s take on the same character, who was much too arrogant in the latter actor’s hands.

Agent Coulson goes after Stark and his wonderfully armored alter-ego, Iron Man; Stark rebuffs the offer, snapping that he’s “not much of a team player” — in Downey’s hilariously haughty flippancy — but gal pal Pepper Potts (Gwyneth Paltrow, a bit sexier than she played this role in the two “Iron Man” films) successfully appeals to his nobler instincts.

Fury, finally, approaches the displaced Steve Rogers (Chris Evans), whose Captain America was a WWII hero before losing half a century in suspended animation and being revived in the 21st century. Rogers — still a man out of time, and constantly puzzled by the culture and technology we take for granted — jumps at the opportunity to once again serve his country.

The major problem, as Stark put into words, is that these guys don’t play well with others; they’re prickly alpha individuals who like to call their own shots, and don’t respond well to authority figures. Indeed, Stark actively distrusts Fury and SHIELD, and of course Thor — when he finally joins the crew — has the imperial aloofness one would expect of a Norse god.

Whedon certainly knows his Marvel Comics lore, and he recognizes — and exploits — the long-standing tradition of impatient superheroes who, at times, wind up battling each other through needless misunderstandings. Thus, Iron Man foolishly gets in Thor’s face, while a hopelessly outmatched Natasha tries to survive a close encounter with the Hulk.

These warm-ups, mostly in good fun, are mere prelude to the devastating climax; it probably isn’t spoiling anything to reveal that the Chittauri do eventually invade New York.

Along the way, longtime comic book fans are rewarded with marvelous moments large and small, from the Hulk’s effort to lift Thor’s hammer — which can be wielded solely by the Asgardian god — to the big-screen debut of SHIELD’s totally awesome helicarrier … and let’s just acknowledge that this film’s special-effects team delivers the goods, and then some.

All these skirmishes are accompanied by droll dialogue, often slightly mocking, but never so arch that things descend into parody. In their previous films, Downey, Evans and Hemsworth have demonstrated a talent for playing these fantastical roles with conviction; Ruffalo, Jackson and Johansson are just as capable. Renner doesn’t have quite as much fun, since Hawkeye spends so much of the film in a brainwashed state, but he makes up for lost time in the final act.

While “The Avengers” lacks the emotional gravitas of “Spider-Man 2” or “The Dark Knight,” it’s only a near-miss; besides, Whedon’s goal is a bit more larkish than the brooding claustrophobia of Christopher Nolan’s take on Batman. Whedon wants us to care about his characters — and we do — but he also wants us to have a good time.

And we do.

— Read more of Derrick Bang’s film criticism at derrickbang.blogspot.com. Comment on this review at www.davisenterprise.com