Four years ago, Casey Harrell sang his last bedtime nursery rhyme to his daughter.

By then, A.L.S. had begun laying waste to Mr. Harrell’s muscles, stealing from him one ritual after another: going on walks with his wife, holding his daughter, turning the pages of a book. “Like a night burglar,” his wife, Levana Saxon, wrote of the disease in a poem.

But no theft was as devastating to Mr. Harrell, 46, as the fading of his speech. He had sung his last Whitney Houston song at karaoke. A climate activist, he had delivered his last unassisted Zoom presentation to fellow organizers.

Last July, doctors at the University of California, Davis, surgically implanted electrodes in Mr. Harrell’s brain to try to discern what he was trying to say. That made him the latest test subject in a daunting scientific quest, one that has attracted deep-pocketed firms like Elon Musk’s company Neuralink: connecting people’s brains to computers, potentially restoring their lost faculties. Doctors told him that he would be advancing the cause of science, but that he was not likely to reverse his fortunes.

Yet the results surpassed expectations, the researchers reported on Wednesday in The New England Journal of Medicine, setting a new bar for implanted speech decoders and illustrating the potential power of such devices for people with speech impairments.

“It’s very exciting,” said Dr. Edward Chang, a neurosurgeon at University of California, San Francisco, who was not involved in Mr. Harrell’s case but has developed different speech implants. A device that just years ago “seemed like science fiction,” he said, is now “improving, getting optimized, so quickly.”

Mr. Harrell’s team sank into his brain’s outer layer four electrode arrays that looked like tiny beds of nails. That was double the number that had recently been implanted in the speech areas of someone with A.L.S., or amyotrophic lateral sclerosis, in a separate study. Each array’s 64 spikes picked up electric impulses from neurons that fired when Mr. Harrell tried to move his mouth, lips, jaw and tongue to speak.