“She was gone before Cannibal Corpse took the stage.”

That’s the first line of “Gone to the Wolves,” the latest novel from John Wray. Wray is a New York-based author known for critically acclaimed novels including “Lowboy” and “Godsend.” Cannibal Corpse is a death-metal band whose albums such as “Butchered at Birth” and “Tomb of the Mutilated” earned a disapproving shout-out from Sen. Bob Dole in 1995.

Wray and the band have something in common.

“I grew up in the ’80s in Buffalo, New York, which is a big metal town,” Wray says via telephone from Mexico City, where he was visiting family. “The first line of the novel name-checks them, first of all, because it’s an amazing name, but also because they’re from Buffalo.”

He pauses briefly.

“I guess I’m about the same age as those guys,” he says. “They might be younger than me, actually. That’s horrible to think about because they’re looking pretty grizzled.”

Wray says this with a laugh; he’s not someone who takes himself overly seriously. And while “Gone to the Wolves” is a serious book, there’s humor in there, too: In one scene, a metal fan and a roadie compete to see who can “come up with the most horrible name of an existing metal band.” Among the (actual) bands named are Lymphatic Phlegm, Pig Destroyer and Chemikill; the ones not mentioned here are worse.

Wray’s novel follows Kip, Kira and Leslie Z, three young people living on Florida’s Gulf Coast in the late 1980s. They come from unhappy homes but forge a friendship centered around their love for metal. They move from Florida to Los Angeles, where they hope to find deliverance on the Sunset Strip, the era’s glam metal capital.

Things don’t quite work out. Leslie Z turns to drugs, and Kira, on a trip to Scandinavia, becomes involved with a black metal cult. Kip and Leslie Z try to find her and bring her home, but it’s a harder task than they’d hoped.

Wray wasn’t a metalhead himself growing up; he favored hard-core punk. He says he was initially “pretty scared” by the metal kids in Buffalo but soon learned that under the scowls and black band T-shirts, they were just young people with a taste for extreme music.

“I have plenty of memories of growing up in Buffalo that are very violent and very scary, but they do not involve people who listen to heavy metal,” Wray says. “They involve preppy kids, hockey players, drunk frat kids at horrible parties.”

Wray says he soon learned that people looked askance at the metal kids for reasons relating to class. Like the three characters in “Gone to the Wolves,” the metalheads of his Buffalo youth came from working-class backgrounds.

“The kids who listened to punk, like Black Flag or Suicidal Tendencies, at least where I was living, they were middle-class, upper-middle-class kids,” he says. “Whereas the metal kids were maybe from outside of town, or from certain less affluent suburbs. I’ve really come to understand more fully that class is this thing we don’t talk about very much in the United States.”

Wray grew interested in metal himself in the late 1980s after “this wonderful thing happened, which I sort of touch on in the book briefly, where there was this kind of coming together of hard-core punk kids and thrash metal kids.”

He was converted to the metal cause by Metallica’s 1988 album “…And Justice for All” (although he makes it clear he is emphatically not a fan of the band’s output after that record).

“That record is an absolute masterpiece,” he says. “It’s a perfect point of contact between politically aware, hard-core punk and all the beautiful excesses of metal. It was a pivotal album to me.”

Wray decided to turn his love of metal into a novel after realizing that the genre hasn’t been as well represented as other types of music.

“How many hundreds of novels and memoirs and films and TV shows have tried to engage with punk or new wave or post-punk?” he says. “You can point to some very fine films and books. But where’s a novel that was written about metal in America? Where’s a film that takes metal as its subject and doesn’t treat it in a campy, tongue-in-cheek way?”

The setting for the novel came naturally to Wray. The late 1980s, he says, were the time when a “cultural civil war” between thrash-metal fans and glam-metal devotees broke out; it was also “a period of great conflict between metal as a self-contained subculture and the culture at large.”

Florida, he says, was a natural place to set the first part of the book. “This was a time when bands who had almost never left the state were selling gold, platinum records. People were moving from Denmark to Tampa to be closer to this scene. It was a very brief window of time, but such a strange and fascinating scene that existed down there.”

To research the part of the book that takes place in Scandinavia, Wray visited Norway, the birthplace of infamous black-metal bands like Mayhem, whose singer Øystein Aarseth opened an Oslo metal record store called Helvete and was murdered in 1993 by a former bandmate.

Helvete doesn’t exist anymore, but a new metal record store is at the same address. Wray went to the shop when he was in Oslo, even descending a spiral staircase to its basement, which has been preserved, he says, as it was in the days of black metal’s heyday in the country. Wray calls the experience “kind of creepy, frankly.”

He had a better time in Los Angeles: “That was the easiest” part of the research, he says; he knew a lot of people who lived in the city during metal’s Sunset Strip heyday. They were undoubtedly familiar with the Rainbow Bar and Grill on Sunset Boulevard, the legendary venue that had been a hangout in the ’70s for Alice Cooper and Ringo Starr and by the ’80s was where members of Mötley Crüe, Poison and Guns ‘N Roses spent time.

The Rainbow Bar plays a part in “Gone to the Wolves” — Kira is a bartender there, and in one scene, Kip has a run-in with Vince Neil, the real-life lead singer of Mötley Crüe.

“I like to think that he would enjoy that scene and find it amusing,” Wray says. “I think he might be a little bit less pleased that the characters in the book don’t think very much of Mötley Crüe’s music.”

Wray will get the chance to revisit the bar soon. He’s scheduled to appear at its upstairs level May 25, where he’ll be in conversation with J. Bennett of The Creative Independent.

The author is looking forward to it. “It’s going to be an extremely gratifying evening for me, I think,” he says, “and very, very fun.”