Last week, the federal Department of Housing and Urban Development released its annual point-in-time count of homeless people for 2016, measuring the number of people on the street on one night in every state and almost every city in the United States.

It's not a perfect measure, since the number can change with weather and other factors. But it is a fairly consistent way of estimating the homeless population over time. In Texas, that number has been dropping steadily.

From 2007, the first year the counts were conducted, to 2016, the number of homeless people in Texas has declined by almost 42 percent — from about 40,000 people in 2007 to 23,000 this year. That's the fifth-biggest drop in the country, behind Michigan, New Jersey, Kentucky and West Virginia. Making this all more remarkable, Texas' population overall has grown by 13 percent over that same time period, which none of those other states can match.

Finally, while 23,000 people are still too many to have on the streets, Texas' homeless population is a far smaller percentage of its overall population — about 8.4 people per 10,000 — than it is in California (30 people per 10,000) New York (11 people) and Florida (16 people).

So is Texas doing something right? Well, yes and no.

Texas' relatively low homelessness rate overall can be credited in part to a natural advantage: low housing costs. The median gross rent in Texas is $870, compared with $1,243 in California, $1,117 in New York and $998 in Florida, according to the Census Bureau. If apartments are more affordable, fewer people are going to be dumped onto the street.

In addition, Texas wasn't hit as hard by the financial crisis — home values didn't drop as much and foreclosures were less widespread, allowing more people to stay in their homes. A burgeoning economy also has created employment opportunities for people at a wide range of education levels.

The good news also is the result of dedicated funding and hard work.

Eric Samuels is the president of the nonprofit Texas Homelessness Network, which helps conduct that point-in-time count, and provides training technical assistance to local government agencies tackling homelessness. He says a big part of the drop is the result of an increase in resources and better decisions on how to use them.

Much of the money to fight homelessness has come from the federal government, and that amount has risen by 70 percent in Texas since 2005:

That money has helped create more housing units for homeless people, Samuels says. But the money also is being used more efficiently. Instead of providing dormlike transitional housing, which costs more to staff and doesn't keep people sheltered for long, more of it is being used for individual apartments where homeless people can live while they stabilize their lives and move toward self-sufficiency. Perhaps counterintuitively, those rent subsidies save money overall.

"If you leave those that are most vulnerable on the street, they're going to go to the emergency room, and law enforcement has to work with those folks," Samuels says.

Efforts have been particularly successful in Houston, which has the lowest rate of homelessness of the state's major cities, in part as the result of a unified effort by government agencies, nonprofits and private philanthropy that have supplemented federal and state dollars. "Houston's done an amazing job," Samuels says.

However, it's still too early to see what the effects of the oil bust will have, especially in cities like Houston, where rents have risen sharply in recent years. Progress isn't always linear, and it doesn't have to be permanent.