It's become common knowledge in Texas - and across the nation, for that matter - that our jails and prisons are now our largest mental health facilities. The Harris County Jail, in fact, is the state's largest. Of the 9,000 or so men and women behind bars on any given day, more than a quarter are taking medication for a mental illness. That means that the jail typically treats more psychiatric patients than all 10 of Texas' state-run public mental hospitals combined.

The state's prison system faces similar challenges. The number of inmates treated for mental illness by the University of Texas Medical Branch, which provides most inmate care, grew from about 14,500 in 2008 to nearly 18,000 in 2012. More than 15 percent of the 151,000 inmates have been diagnosed with some form of mental illness, at a cost of $60 million for mental health services. Spending for substance abuse treatment, often connected to a mental illness, was about $172 million in 2012 and 2013.

The problem has become so acute that Lt. Gov. David Dewhurst earlier this year charged the Senate Committee on Criminal Justice with studying the state of mental and medical health care within the prison system. He urged the committee to find ways of saving money and reducing the rate of repeat offenders. Two House committees are exploring similar issues.

The best way to accomplish the lieutenant governor's dual goals, at both the state and county level, is to provide adequate treatment in the community, before the individual gets caught up in the over-burdened criminal justice system. But that's hard to do. Despite funding increases from the Texas Legislature in the last couple of years, Texans still live in a state that's near the bottom in per capita mental health spending. In Houston, for example, an estimated 70,000 adults and more than 14,000 children with severe mental illness need help from underfunded mental health systems but can't get it.

The reason for that inequity is that community-based mental health care is funded mostly by state government, and until recently the Legislature squeezed funding for local programs to the bare minimum. Cut off from treatment, many individuals with mental illnesses ended up behind bars.

That approach is not only inhumane but incredibly short-sighted. According to reliable estimates, an entire year of community-based care costs less than an average jail stay of 40 days.

Relying on jails to house the mentally ill is about as short-sighted as turning down expanded Medicaid funding. When Gov. Rick Perry and his Republican cohorts in the Legislature refused to expand Medicaid under the Affordable Care Act, they in essence turned down an opportunity to assist some 90 percent of the individuals who are currently a part of the public mental health and substance abuse system.

"The state of medical and mental heath care within the prison system presents an opportunity for Texas to improve a process that could ultimately save money and reduce the rate of repeat offenders while better protecting public safety," Dewhurst said last week.

He's right about that, but until he and other elected officials show that they're willing to make the necessary investments in a more sensible approach to helping the mentally ill, then nothing's going to change. We have to hope they'll show more courage and foresight.