As the weather warms up, families across California are planning summertime visits to the beach. But overnight trips to the state’s famous coastline are becoming increasingly difficult for middle-class residents to enjoy because the price of admission is soaring.

Thousands of old, relatively low-cost motel rooms along the coast have been closed in recent years, replaced with luxury hotels that are out of reach for many.

The average summer hotel room within a mile of the coast now costs $302 a night in San Mateo County, $245 in Santa Cruz County and $274 in Monterey County, according to a new survey from the California Coastal Conservancy. In Southern California, the prices are similar: $254 a night in Los Angeles County, $287 in Orange County and $343 in Santa Barbara County.

A new wave of studies in recent months is sparking efforts by California’s coastal leaders — and now some lawmakers in Sacramento — to do something about it.

“The coast belongs to all Californians,” said Sam Schuchat, executive officer of the Coastal Conservancy, an Oakland-based government agency that works to restore the coast and improve public access. “And all Californians should be able to access it and enjoy it. Why should only relatively wealthy people be able to spend the night?”

The conservancy commissioned a telephone poll in March of 1,200 California residents and found wide disparities in who is able to stay overnight when they visit the beach.

The poll found that while 67 percent of California residents with household incomes over $200,000 a year stay overnight when they visit the coast, only 41 percent of those with household incomes between $50,000 and $75,000 do. And just 25 percent of people with incomes under $25,000 stay overnight.

There are also racial and ethnic differences.

While 51 percent of white California residents say they stay overnight when they visit the beach, 74 percent of Latinos, 70 percent of Asians and 64 percent of African-Americans say they do not, with price being the main reason.

The reasons for rising hotel rates: Land costs are expensive. The economy is good. Californians are competing with tourists from around the world for a limited number of affordable rooms. And it’s illegal under state law for the government to set hotel rates.

Reading this on your phone? Stay up to date with our free mobile app. Get it from the Apple app store or the Google Play store.

“It’s the workings of the marketplace,” Schuchat said. “Coastal real estate is incredibly expensive. Let’s say you have been operating a cheap motel along the coast and you are getting older and you want to retire. So you are going to sell it. Who is going to buy it? Somebody who wants to build something more expensive. Cities make more money in taxes from a Ritz-Carlton than a Motel 6.”

On a recent afternoon in Santa Cruz, beach visitors said they would like to stay overnight more, but costs are a barrier.

“I don’t think I’ve ever stayed overnight here,” said Rachel Devaul, of San Jose. “Most of my friends are young parents with kids. You don’t have a lot of extra money.”

Concord resident Michael Slaker agreed.

“It’s only about an hour’s drive to Concord,” he said. “It’s not cost-effective for us to pay those prices. If you go further away, like down to Disneyland, then you have to bite the bullet and pay.”

Since 1989, there have been 35,967 hotel rooms along the California coast that have been lost, and 70 percent have been economy rooms, according to a study last year by the California Coastal Commission, a state agency in San Francisco that regulates coastal development.

Schuchat says he’s even considering a program to work with UC campuses along the coast to rent out dormitory rooms in the summer to tourists.

It’s all about supply and demand, says the state’s hotel industry.

“It’s a tough issue,” said Lynn Mohrfeld, president and CEO of the California Hotel and Lodging Association in Sacramento. “It’s highest-and-best use for coastal real estate. You can apply the same issue to housing, retail or other types of businesses. If somebody buys a two-bedroom house on the coast, they aren’t going to tear it down and put up a one-bedroom house or a studio. I don’t think it’s unique to the hotel industry.”

Mohrfeld said one solution is for the state to build more campsites, more cabins and to fund more partnerships with youth hostels on coastal land already owned by the state. The state parks department, for example, owns roughly a third of the coastline, but it has built few new campgrounds or cabins in the past decade.

A new push is underway in Sacramento to make coastal lodging more affordable.

Democratic state lawmakers recently added $100 million to AB 18, a $3.1 billion bond proposed to go before voters on the June 2018 ballot to fund parks and water projects. And Assemblywoman Lorena Gonzalez-Fletcher, D-San Diego, has introduced a bill requiring the Coastal Conservancy to create a low-cost overnight accommodations program.

Mohrfeld said people who can’t afford oceanfront hotel rooms can book less pricey rooms inland. As a college student, he said, he’d go to San Diego to surf, but stay with friends in lower-cost motels in Santee, a town about 10 miles from the coast.

Jack Ainsworth, executive director of the California Coastal Commission, said he plans to raise fees on developers of luxury hotels along the coast to help fund new campsites, cabins and hostels.

The commission has collected $24 million in such fees over the past 40 years and awarded them to cities, state agencies and nonprofit groups, but $13 million remains unspent. Many of the projects have turned out to be more expensive than anticipated, due to land costs or because of local opposition, which can cause delays and increase costs.

Mohrfeld said raising fees will simply cause hotel owners to raise prices, but Ainsworth said owners of expensive hotels can afford it.

“These hotels are incredibly profitable primarily due to their location in what is one of the strongest coastal hotel markets in the nation,” Ainsworth said.

Not only does the 1976 California Coastal Act require that low-cost accommodations be protected, Ainsworth noted, it’s important for kids to be inspired by the coast.

“There’s something very special about waking up at the coast,” Ainsworth said. “The sights, the smells, the sounds. It burns into your heart and soul, and that’s how we get people interested in the coast and protecting our natural resources.”