LAWRENCE, Mass. — When Eddie Frasca was shooting up heroin, he occasionally sought out its more potent, lethal cousin, fentanyl.

“It was like playing Russian roulette, but I didn’t care,” said Mr. Frasca, 30, a carpenter and barber who said he had been clean for four months. When he heard that someone had overdosed or even died from fentanyl, he would hunt down that batch.

“I’d say to myself, ‘I’m going to spend the least amount of money and get the best kind of high I can,’ ” he said.