A 39-year-old computer program analyst was found shot to death early yesterday in Gaithersburg and a 29-year-old man who shared his house was later arrested and charged in the death, Montgomery County police reported.

The victim was identified as Charles J. Spell, of 9833 Whetstone Dr., Gaithersburg. He worked in the U.S. Department of Energy under the assistant secretary for fossil energy. His body was found shortly after midnight at the side of Blunt Road, a rural road near his home.

Police said he had been shot once in the head, apparently an hour or two before his body was found.

Police said they arrested Gerald S. Sibley last night and charged him with murder in Spell's death. Sibley had lived in Spell's house for about a year, acting as a handyman in exchange for rent, police said.

They said the two men had argued in March over the terms of the arrangement. After the argument, police said, Sibley had left the house. However, they said he still listed himself at the Whetstone Drive address and was picked up there last night for questioning that proceeded his arrest.

Police said Spell was separated from his wife and lived with a 13-year-old son.