Editors' pick: Originally published Feb. 27.

Investing in rental homes does not always generate high returns and depends largely on how popular the market is and the current state of the economy.

Some cities tend to generate higher profits for investors, because the need for rental housing is higher due to a lack of affordable housing in major cities such as San Francisco and New York or where there is a large concentration of jobs being offered.

Landlords should also factor in other costs that can affect their profit margin such as higher property insurance and taxes, maintenance expenses and homeowner's association fees, said Bruce McClary, spokesman for the National Foundation for Credit Counseling, a Washington, D.C. non-profit organization.

"While landlords might expect a good return on their property investment in some communities, there are a few costs that can chip away at the profits," he said.

Rental properties can also emerge as a "liability for those hoping to tap into the home equity at a competitive rate," McClary said.

There are many lenders who will not approve a home equity line of credit that uses a rental property as collateral and even the ones who approve a loan are likely to charge higher than average interest rates, he said.

The number of Americans renting has increased, as even retirees are opting to forgo homeownership and instead rent to give themselves additional mobility and disposable income in order to fund other retirement expenses.

Renting is emerging as a preferred alternative for both Millennials and Baby Boomers, since in many cities, it is a cheaper alternative, according to a report conducted by Trulia, a San Francisco-based real estate website.

During the period of 2005 to 2015, the largest group of renters to increase was Baby Boomers or those 50 and older with a 55% gain, according to a Harvard University's Joint Center for Housing Studies report. Gen X-ers, ages 30 to 49, reported an increase of 34% and a rise of 11% occurred among those under 30.

TheStreet Recommends

A greater proportion of Americans are renting with 37% doing so in 2015 compared to 31% in 2005, the highest level since the mid 1960s, the report said.

Renting is spreading across income groups since 18% of the increase in renters during this decade earned $100,000 or more, and the number of renters in the top income bracket grew by 61%, according to the report.

Investors should be conservative when estimating their returns, because there are other fees such as real estate agent commissions, periods of time when there are vacancies or paying a property manager, said Samantha DeBianchi, a Fort Lauderdale-based real estate agent.

"When looking at property for sale with the intention to rent, don't trust what the advertising cap rate is," she said. "Many times the advertised caps are not what the property is currently producing, but rather predicted caps." 

In the aftermath of the recession, investors found the surplus of distressed properties resulted in another market - the single-family rental home market, said Jeremy Sicklick, CEO of HouseCanary, a San Francisco-based residential real estate data company.

An analysis by HouseCanary demonstrates that the "best markets for renting a home are not necessarily the places that have shown the largest appreciation in home prices," he said. The best returns for investors are located in the Midwest, the South and Texas.

Coastal cities and states have tended to produce more modest returns while northeast states, including New York, are generating returns in line with the national average of 9.1% a year, said Sicklick. West Coast states, including California, are generating returns below the national average and even the 8% that "investors consider to be an adequate return," he said. While many cities have demonstrated growth in growth in housing prices, it has not resulted in higher returns for rental properties in places such as San Francisco, San Jose and Los Angeles.

"They are producing the lowest average returns for renting single-family homes, and it is because the rapid home appreciation in those places is outpacing the ability of homeowners to boost rents and is constraining their rental profits," Sicklick said.

The cities which have more modestly priced homes, such as Rochester, N.Y., St. Louis, Pittsburgh, Detroit and Houston, continue to be "strong bets for investors looking to rent single-family homes, even when they have had solid price appreciation, as in the case with Houston," he said.

The number of people living in single-family homes includes 15.1 million households or 35% of the population or 47.6 million residents comprising of 43% of the total population, according to the U.S. Census Bureau.

Here are the top ten best cities for rental homes based on the annual return on investment, according to HouseCanary's data: