BRAINTREE - More than 20 homeless families living at Extended Stay America hotel in Braintree are facing the reality of being relocated to another motel or a shelter in the coming months, but they don’t know where they are going yet.

Massachusetts housing officials said the move was spurred by the hotel chain’s decision to pull out of the state’s Emergency Assistance Program in all its locations except for Danvers, forcing the state to find new shelter for more than 150 families statewide.

“They’re just throwing us anywhere they can find a spot,” said Corin Janey, the mother of a 2-year-old who lost a job at a local department store while she was pregnant and then became homeless more than a year ago.

A letter to the affected homeless families from the State Department of Housing and Community Development explained to families that their “placement out of Extended Stay may be to a location more than 20 miles from your home community.”

Janey, who used to own a condominium in Canton, has lived at the motel in Braintree for almost a year and is worried that the state will move her to a distant or dangerous location.

Aaron Gornstein, the undersecretary of the State Office of Housing and Economic Development, said that the state is trying to find permanent housing or other shelter sites for families living at Extended Stay sites.

“The second option is to move them to a different shelter nearby, and keep their kids in same school. And if they have a job for them to be near their employment situation. But that’s not always possible,” said Gornstein.

Extended Stay America Hotels, whose corporate headquarters are based in North Carolina, did not return calls for comment.

Homelessness continues to be a stubborn problem in the state with rising numbers of people showing up at homeless shelters and little change in the numbers of homeless families being housed in motels paid for by the state.

At $82 a night per family, the state is spending more than $1 million a week to shelter 1,992 families in motels across Massachusetts. Last August, there were 1,710 homeless families in motels. That number peaked at 2,160 families last December.

Entries into homeless shelters shot up more than 40 percent over the last two fiscal years from 4,272 to 6,167, said Gornstein.

“We’re employing as many strategies as we possibly can, but we are still facing a high demand for emergency shelter,” added Gornstein. “Some families are still struggling. We are seeing large increases of eviction. Rents are going up, and there are families who are doubled up in homes.”

Massachusetts is the only state in the U.S. that mandates shelter as a right, but some other municipalities, such as New York City, also have similar laws to shelter the homeless.