It’s a good time to be a superhero. This summer, the silver screen debut of “The Avengers” broke box office records. Receipts for that team of super-powered champs who stepped from the pages of Marvel Comics even outmatched sales for an old rival. Batman, that iconic character from DC Comics, had to settle for second place in theaters this year.

An “Avengers” sequel is on the way, of course, and so are more sequels featuring the characters that make up the Marvel super team. It’s a brilliant, fan-pleasing bit of business: As a popcorn-eating moviegoer and parent, all I really need to know is the release date and a time to show up at the theater.

Marvel’s history, as chronicled in an exhaustive new book by Sean Howe, “Marvel Comics: The Untold Story,” isn’t exactly filled with examples of such corporate coordination. Sixteen years ago, the struggling publisher declared bankruptcy, and this was only the most public of embarrassments for an outfit that has reached success beyond comic books only after making every possible mistake.

Most of the Marvel superheroes breaking box office records today were created half-a- century ago. The comic book industry was already dying, we are told; nobody was interested in comic books anymore, thanks to movies and TV.

At the time, Stan Lee, a comic book writer and editor, appeared to be at the end of a once-promising career. Ordered to come up with a title that would compete with a new series from Marvel’s larger competitor, DC Comics, he had nothing to lose as he grasped for something unique. His next creation, The Fantastic Four, was a team that didn’t have secret identities, and its members spent as much time bickering with each other as fighting bad guys. One member, the rock-skinned Thing, was so grouchy that it seemed as if he might start clobberin’ his comrades at any minute.

"Marvel Comics: The Untold Story" by Sean Howe. (Harper)

For comics readers, this was compelling stuff. More conflicted characters, such as Spider-Man, Iron Man and the X-Men, soon followed, each with a stack of inner struggles. Marvel became so popular that it moved to a larger headquarters. In the letters pages of its comics, the new address was kept a secret to discourage the masses from showing up on the doorstep.

Marvel’s comeback is as inspirational as any underdog story the publisher has ever inked, although artists and fans still quibble over the myth’s details. Howe’s book serves to expand on Lee’s famously cheery and streamlined version of events.

In the early days, Lee and his team worked so quickly, in a medium that seemed so ephemeral, that few creators thought to ask for royalties. Decades later, Marvel’s most famous artist, Jack Kirby, complained bitterly that he hadn’t been paid fairly or gotten proper credit for his work. Kirby’s name is only the most celebrated one on a long list.

Marvel’s in-house struggles reached the executive boardrooms as well. As the industry contracted, character rights were signed away in convoluted, cheapo deals that usually went nowhere. To diversify out of the struggling comic book industry, Marvel invested in trading cards, another dying industry.

Eventually, Marvel ended up as part of one corporate juggernaut or another with no interest in caped crusaders. One distracted executive couldn’t keep straight whether Marvel owned Spider-Man or Superman, that other iconic character from DC Comics. (Marvel is now owned by Disney, which acquired the publisher in 2009 for $4 billion.)

Readers looking for a good guy to root for, or a clear villain, will be disappointed, however. Lee comes off as a credit-hogging self-promoter, and his artists seem cantankerous and naive. It’s possible that both versions of the story are accurate.

Howe’s book covers too much ground for one tight story arc. Rather, it’s the same tale told several times: Marvel’s writers and illustrators get frustrated and eventually either leave or are pushed out the door. Most of them make no money, and none of them enjoys loyalty from his employer. In recent years, even Lee is regarded as an outsider after he starts an independent venture; a Marvel conference room chuckles at an announcement that his start-up has failed.

Jack Kirby, left, and Joe Simon, co-creators of the Captain America comic, are shown. (Anonymous/AP)

In the end, it’s no wonder that Lee crafted stories about talented groups of people who couldn’t stop fighting among themselves. He was writing from experience.

Musgrove is a former reporter, and comic book reviewer, for The Washington Post.

Marvel Comics

The Untold Story

By Sean Howe

Harper. 484 pp. $26.99