The artist Pedro Reyes is a biting social critic whose pieces often hold out hope — in the face of overwhelming evidence to the contrary — that things will get better.

In “Palas por Pistolas” (“Shovels for Guns”), in 2008, he set up a program that allowed residents of Culiacán, Mexico, a city devastated by shootings, to trade in their guns for food stamps or household appliances; the guns, more than 1,500 of them, were melted down and turned into shovels. In a 2013 work with similar implications for good but a much higher threshold for rethinking, he came up with the Grass-Whopper, a burger made with plentiful, crunchy grasshopper protein instead of beef.

But when he and the New York public art organization Creative Time began discussing a piece to coincide with the homestretch of the American presidential campaign, Mr. Reyes settled on an idea that allowed little in the way of light: the professional haunted house, an essentially American creation (by way of Grand Guignol and Victorian ghostiana) for generating shock and fear.

“The haunted house has never really been considered an art form, but it’s a true folk art — every town has one at Halloween,” said Mr. Reyes, whose own version, “Doomocracy,” opens Friday within the sprawling Brooklyn Army Terminal in the Sunset Park neighborhood. “Haunted houses don’t have a narrative or make sense. You’re there to be terrified, to be a masochist. So those are the limits I decided to work within for this.”