One popular trick is to hide a room behind a bookcase that looks like a standard built-in but is equipped with hidden hinges, rollers and handles, as at the Beghous’ house. Contractors can either build the bookcases themselves or buy a piece from a growing collection of companies, including Niche Doors, the Hidden Door Company, Hide a Door, Secret Doorways and Decora Doors. Prices range from about $800 for the most basic models to more than $10,000 for custom-made versions.

Steven Humble is the owner and chief engineer of Creative Home Engineering, a two-year-old business in Tempe, Ariz., that specializes in mechanized doors that conceal rooms or safes. He echoed others in the business in saying that his customers are evenly split between those who plan to use their hidden rooms for security (either to hide valuables or to hide themselves in an emergency) and those who just think they are “really cool.” His company has built about 25 customized doors, bookcases, safes and assorted pieces, for new and remodeled homes, including a fireplace with a rear wall that swings open to reveal a room beyond, for a house in Arkansas. Prices run from about $5,000 to $25,000.

Last month Mr. Humble installed a pair of hidden doors in a house in a town north of Sioux Falls, S.D., for ABC’s “Extreme Makeover: Home Edition.” “Whether it’s for home security or people’s images of living like James Bond, it seems to be something people respond to,” he said.

James Bond, or Herman Munster. When Louise Kircher, a retired teacher, and her husband, Dennis, a former accounting manager at Boeing, moved into their year-old, 4,300-square-foot contemporary home in Mesa, Ariz., in January, the staircase in the master bedroom was “something extra that came with the house,” Mrs. Kircher said, and reminded them of something out of “The Munsters.” It rises to reveal a hidden room, where she and her husband store an antique bedroom set and a replica of a gilded mummy’s coffin. “The ceiling is only five and a half feet in there,” she said. “I think it would make a great playroom for grandkids.”

Secret rooms speak to the homeowner’s sense of playfulness and perhaps to something deeper. “When we started the company we thought we were going to only attract eccentrics,” said Krystal Strong, co-owner of Hide a Door in Humble, Tex., whose doors’ average cost is $1,600. “But I think everybody is on the eccentric side; they want to make their home unique.”

Image Cami Beghou swings open a bookcase to reveal her study area. Credit... Michelle Litvin for The New York Times

To Sarah Susanka, a residential architect based in Raleigh, N.C., and author of “The Not So Big House,” a hidden room is “a way to individualize your house.” She said, “For a house to feel like a home, people have to put more of themselves in their house.” She remembered a woman in St. Paul who asked for a room hidden behind the rear wall of a closet. “She said she wanted a secret room for her art studio,” Ms. Susanka said. “She was a very introverted person, and she had to hide in order to let this expressiveness out.”