Who takes care of the unclaimed dead, the people who were homeless or estranged from family members, or who outlived all their kin, and left no assets behind?

The answer is usually funeral homes that get reimbursed by state or local governments for the cost of cremation or burial. But payments are not keeping up with ever-rising expenses in some places, like Massachusetts, meaning the number of funeral homes willing to shoulder the burden is dwindling. In at least one state, West Virginia, drug overdose victims have used up nearly all the money set aside for the unclaimed dead.

“These are human beings, someone’s mother, father, sister, brother,” said Peter Stefan, a funeral director in his 70s who buries dozens of unclaimed bodies a year in central Massachusetts. “What do you do with these people? If I leave this place this way, the poor won’t have too many options.”

The $1,110 reimbursement for funeral directors who bury the indigent and unclaimed in Massachusetts hasn’t risen in 35 years. The total cost for their time, the casket, transportation of the corpse and a burial plot can be double that, they say.

Cremation is cheaper, but that’s impossible if, as is required in some places including Massachusetts, funeral directors can’t find kin to sign off. That leaves them scrambling to find discounts or covering some costs themselves.

“As long as you have two or three funeral homes that are willing to do this, it’s not a problem,” said Robert Lawler, a Boston funeral director who buries about 100 unclaimed bodies a year. “But what happens when we decide we can’t do it anymore?”

Directors recently became eligible for an extra $1,000 if they accept bodies from the Massachusetts medical examiner’s office, which investigates suicides and suspicious and accidental deaths. But that accounts only for some bodies.

About 15 states provide some funding for unclaimed body burials or cremations, while the rest have pushed the cost to local governments, said Scott Gilligan, general counsel for the National Funeral Directors Association.

Ohio, for example, used to pay $750 before shifting the burden to local governments. Now, some communities offer a set fee, while some smaller towns often won’t even budget for it and funeral directors have to fight to just get paid $350, Gilligan said.

“A lot of times, they just do it as good citizens,” he said.

In West Virginia, there will soon be no money for the cremation or burial of the poor and unclaimed. The state fund that pays for them is set to run out of money at the end of this month because of drug overdose deaths, said Robert Kimes, executive director of the state funeral directors association.

Directors who bury the indigent and unclaimed from March on will have to try recouping money from the state later, but there’s no guarantee, Kimes said. Lawmakers are considering lowering the $1,250 payment to $1,000 but doing away with some things funeral homes have to pay for, like a vault, to make the fund last longer, he said.

In northwestern Georgia’s Floyd County, Coroner Gene Proctor last year was calling five or six funeral homes every time he had an unclaimed body before he could find one willing to bury it for the $1,250 the county provided.

“I couldn’t blame them because … they’re a business and they have to make money to survive, and here I am asking them to cost themselves money,” said Proctor, who handled about 90 unclaimed sets of remains last year.

He recently persuaded the county to pass an ordinance that provides for the cremation of the unclaimed. Now, funeral homes get $750, and every director in the county is stepping forward, he said.

In Massachusetts, Stefan wants lawmakers to require local health boards to approve cremation when relatives don’t come forward within 30 days. He and his supporters, including Democratic state Senate President Harriette Chandler, say they believe it would make more funeral homes willing to help out with abandoned bodies.

Stefan, who arranged the burial of Boston Marathon bomber Tamerlan Tsarnaev, is often the go-to funeral director for police, nursing homes and hospitals.

He smoked from a wooden pipe as he explained how the body of James Oram, 82, arrived at his Worcester funeral home hours after dying at a nursing home in January.

Oram’s body spent about a month in an unfinished basement in a large refrigerator where Stefan can keep three bodies as he looks for relatives, money and burial space. Others are placed in caskets and stored in a room kept cold.

The body of one man who wanted to be buried at sea has been at Stefan’s funeral home for more than a year. Nearby, hundreds of containers of cremated remains that were never picked up by relatives line rows of shelves; some date to the 1800s.

Stefan eventually discovered that Oram died with about $2,000, money that paid for his burial instead of the state.

On the unusually warm February day Oram was laid to rest, a funeral director read the 23rd Psalm as cemetery workers put his simple blue casket adorned with white and yellow flowers into the grave and covered it with dirt.

Stefan and the others looked at the grave of the man whose information in their possession fit on a single sheet: White. Male. Single. Factory Worker.

“These people were born, grew up, went to high school,” Stefan said. “What happened in the middle? Who knows.”