wsjlogoSAN FRANCISCO—When Alexandra Goldman got notice of her rent increase—from $6,000 a month on a five-bedroom house she shared with roommates to $11,000—she says she was in disbelief.

“We knew immediately we were not going to be able to pay that much money to live there,” said Ms. Goldman, a 28-year-old planning consultant whose share of the rent was about $1,000 a month. After receiving the notice in October, she said the house’s occupants ended up dispersing to other rentals. She is living with other roommates now and paying about $300 more than she had before. Her former landlord didn’t immediately respond to requests for comment.

Welcome to what is arguably one of the worst cities in America to be a renter, but among the best to be a landlord and apartment investor. San Francisco led the top-50 U.S. metropolitan areas in average rent growth during the second quarter, jumping 7.8% to $2,498, while Oakland was No. 2 at a 6.9% increase, and San Jose was in fifth place at 5%. The 6.8% increase for the combined San Francisco Bay area was more than double the nation’s 3.1% increase, according to preliminary estimates by MPF Research, a market-research firm in Carrollton, Texas.

The rent increases have investors rushing to purchase existing properties. San Francisco-based Ridge Capital Investors, for example, has acquired nearly 500 units throughout the area since 2011, including a 45-unit apartment complex in San Mateo, a city south of San Francisco, for $10.95 million in November. Trevor Wilson, managing director of Ridge Capital, said his company has competed against as many as 30 bidders on multifamily properties in recent months.

“We’ve been trying to find more [properties], but there’s not a lot available,” said Mr. Wilson, who added his firm is spending about $1.5 million to refurbish units at the 34-year-old Mariner’s West Apartments in San Mateo so rents now well below market levels can be raised. Tenants there are now paying as much as $1,000 below the market rate of $2,300 to $2,400 a month for that area, Mr. Wilson said.

Fueling the rental increases in San Francisco and many other cities across the country are a resurgence in two key industries—technology and energy—and a generally improving economy nationwide, said Ryan Severino, senior economist at Reis Inc., a market-research firm in New York. Rents in energy-rich Denver jumped 6.1% from a year ago, according to MPF Research, while Seattle, another tech hub, saw rents increase 6%.

Mr. Severino said rents are rising the fastest in cities with the tightest supply of housing, like the Bay Area and Seattle. San Francisco’s vacancy rate for multifamily housing in the second quarter stood at 3%, the same as a year earlier, compared with a national average of 4.7%, according to MPF.

Some cities with less-robust job markets enjoyed a strengthened market but remained at higher vacancy rates amid deeper housing inventories. Philadelphia’s vacancy rate dropped to 5.4% in the second quarter, from 6.1% a year earlier and compared with a national average of 4.7%. The rate in Las Vegas fell to 7.5% from 8.4%, and in Memphis, Tenn., to 8.9% from 10.1%, according to MPF Research.

For the nation’s tightest apartment markets, some observers worry the local labor pool may eventually go down, because of people being driven away. In Ms. Goldman’s case, she said she and her roommates mostly had the means to remain in San Francisco but said that may not be the case for everyone. “It’s getting a little out of control,” she said.

Regarded by industry analysts as chronically underhoused, San Francisco added 31,000 jobs in 2012 in a city of about 800,000. That is resulting in sticker shock for new arrivals. Leena Rao, with her husband, Suneel Gupta, recently leased a two-bedroom, two-bath home for between $4,000 and $5,000 a month, compared with $2,150 for the two-bedroom they left behind in Chicago.

“It was a brutal surprise,” said Ms. Rao, 31, an editor for a technology news website.

The tight supplies have unleashed a torrent of new construction in the Bay Area, with 14,377 units permitted for construction over the next 18 months, or almost as much as for Houston, typically a much more active building market, according to MPF Research. In San Francisco, the 22-story 1190 Mission at Trinity Place building preleased half its 419 units before opening July 1, with all the tenants signing agreements without the customary practice of having toured a model or attended an apartment tour, said Rob Willis, director of operations for Trinity Management Services, the builder. “We have never seen this,” Mr. Willis said.

Some homeowners are seeking to cash in on the demand. Jane Shepard said she and her husband, Avrum, plan to rent their four-bedroom, two-bath home in San Francisco to help raise money for needed repairs. “Financially, it’s a great time to be a landlord,” said Ms. Shepard, 67, a commercial-property manager. She said the couple would move to their second home in Visalia, Calif.

But renters with less means are finding fewer options. Dawn Griffin, 55, said she was served with an eviction notice in January on her $725-a-month apartment near the city’s Golden Gate Park. Landlord Elba Borgen, who didn’t return calls for comment, also served eviction notices on the other seven tenants in the building, said Ted Gullicksen, executive director of the San Francisco Tenants Union, which has offered advice and other help to Ms. Griffin and other tenants in her building.

“I can’t afford to move,” said Ms. Griffin, a 30-year resident of the apartment and a medical-office administrator.

Still, some tenants have turned the situation into opportunity. Sam Parr said he ended up starting a business matching roommates with apartments after moving to San Francisco from Nashville, Tenn., last year and seeing prices so high he needed to share rent with someone, too. “I thought, oh my God, this is awful—something has to be done,” said Mr. Parr, 24, who sold the business to a larger startup and now shares a $3,500-a-month house with three roommates.