Historical novelist Fiona Davis sets her books in famous New York City buildings — among them the Dakota apartments and Grand Central Terminal. It was only a matter of time before she got to the Chelsea Hotel, which devolved from the height of glamour to the depths of seediness in a matter of decades. The hotel was home to luminaries in show business and the arts, including Arthur Miller, Stanley Kubrick, Janis Joplin and Sid Vicious (who killed his girlfriend there).

But the novel doesn’t track this rise and fall so much as explore, in sometimes gripping fashion, friendships and betrayals in the 1950s, the red-baiting McCarthy era. It tells the story of Hazel Ripley, an aspiring playwright, and Maxine Mead, an acclaimed actress and eventual movie star, as they strive to make it in the world of theater. They first meet in Naples in 1945 on a United Service Organizations tour as actresses. Initially, Hazel hates both Italy and Maxine. But the two women quickly make a connection that matures into a lifelong bond.

Hazel is a plain-Jane blonde who blends into the background, best known for being an ­in-demand understudy on Broadway and good luck charm (if she’s cast as an understudy, the lead never gets sick). She has never actually appeared onstage. Maxine is an all-eyes-on-me, brash redhead, oozing sex appeal. Their friendship endures through war and, when they return stateside, the tribulations of the McCarthy era.

Back home in postwar New York, Hazel, on a whim, decides to move into the Chelsea Hotel, which Maxine described to her as a wonderland for actors, writers and creative types. It is “a safe haven for artists, for activists, for freedom.” And there she discovers herself as a playwright with the help of an eccentric older actress, Lavinia Smarts, a well-connected grande dame who has agreed to read Hazel’s play. Hazel goes from zero to Broadway in 1950 when she attempts to get her first show mounted on the Great White Way.

The author Fiona Davis. (Deborah Feingold)

In an unlikely and totally unexpected reunion, her dear friend Maxine leaves Hollywood and becomes her star. At this point, Joseph McCarthy is just picking up steam and the entire entertainment industry is holding its breath, waiting to see whose name will be next to appear in Red Channels, a pamphlet that lists suspected communists who should be blacklisted. As a result, liberals and agitators are targeted, dragged in front of the House Un-American Activities Committee, censored, silenced and taken down. “Because of this we lost a generation of talent. Screenwriters became typists to earn a buck. Brilliant actors sold shoes to make a living,” Hazel says. “This is how a society is corrupted, from the inside out.”

Davis tells a very good story and deserves all the praise she won for her other books set in famous New York landmarks. A onetime actress, she is a ­meticulous researcher who holds a master’s degree in journalism from Columbia University. In this novel, her journalistic skills shine — her attention to detail lends a fullness and context to the plotlines and characters.

The author says her novel was inspired by interviews with a 98-year-old actress who told her about the persecution, including blacklisting, that the McCarthy-era theater world faced. The book deftly portrays this period as a time when personal grudges and jealousies — a casual culture of denunciation — can have disastrous consequences for the lives of innocent people.

The beginning of the book seems to lack direction but does quite well at establishing the personalities of the two main characters. The pair forge a credible emotional bond — a closeness that will be tested by copious complications.

Quickly but determinedly the story jumps to 1967, when hippie rockers inhabit the Chelsea. Here all of the pieces come together. What finally emerges from the mix of detailed research and solid writing is a tale that is intricate and subtle, unpredictable and exciting.

Michele Langevine Leiby is a Washington-based freelance writer who has contributed to The Washington Post Style and Arts sections and the Sunday Magazine.

The Chelsea Girls

By Fiona Davis

Dutton. 368 pp. $27