The stock market as a whole is near record highs, and the S&P 500 has risen more than 8% in the first half of 2017. However, while many industries have done as well or better, some have not shared in the market's gains. For example, much of the retail sector has been beaten down thanks to e-commerce fears, and the self-storage business is dealing with oversupply worries.

The good news is that within these industries, there are plenty of bargains to be found. Here are two real estate investment trusts that pay attractive dividends and look particularly cheap right now.

Company

Recent Share Price

Dividend Yield

Stock Performance (YTD)

VEREIT (VER)

$8.14

6.8%

(3.8%)

Life Storage (LSI)

$74.10

5.4%

(13.1%)

Data source: TD Ameritrade and author's calculations. Share prices and dividend yields as of July 1, 2017.

Retail real estate still looks good long-term

VEREIT is a net-lease REIT focused on retail and restaurant properties, with smaller concentrations in the office and industrial segments of net-lease real estate. Of the company's portfolio of roughly 4,100 properties, more than 90% are occupied by retail or restaurant businesses.

Sale sign in retail store window.

Image source: Getty Images.

If you aren't familiar with net-lease real estate, it is basically a structure where tenants sign long-term leases that require them to cover certain expenses such as property taxes, building insurance, and some maintenance costs. Typically, these leases have annual rent increases, or "escalators," built in. The goal is to minimize vacancies and to create a predictable, growing income stream.

Due to the general market pessimism regarding the retail sector, VEREIT has performed quite poorly over the past year or so. However, not all types of retail are struggling. Discretionary types of retail such as apparel and jewelry businesses are indeed facing tough times, but these make up just 0.2% of VEREITs portfolio.

On the other hand, some types of retail are doing quite well, particularly off-price retailers like Family Dollar, Dollar General, and BJ's Wholesale Club, all of whom are among VEREIT's top 10 tenants. Others are virtually immune to the e-commerce headwinds that are threatening other brick-and-mortar retailers, especially restaurants, which make up about 43% of VEREIT's properties.

Because of this, as well as the company's solid balance sheet, there is little need to worry about VEREIT's rental income, or the safety of its dividend. In fact, the portfolio occupancy rate is above 98%, and the current dividend represents just 72% of the company's first-quarter adjusted funds from operations (FFO) on an annualized basis -- a rather low payout ratio for a REIT.

Self-storage is a winning business

As I mentioned, REIT stocks have been under pressure over the past year or so in anticipation of rising interest rates. Self-storage REITs have had a particularly tough time, mainly due to oversupply fears in the industry.

However, I believe the self-storage business is a long-term winner, and Life Storage is one smart way to play it. With 675 storage facilities, Life Storage is not the largest player in the industry, but the company is growing rapidly, adding 100 facilities in 2016, while maintaining occupancy above 90% and growing rental income per square foot.

Graph of Life Storage's growth since 2006.

Image source: Life Storage investor presentation.

Life Storage has performed incredibly well in recent years, more than doubling its FFO since 2011 thanks to an annualized same-store revenue growth rate of 6.2% and slow-growing expenses. Shareholders have been handsomely rewarded with big dividend increases and strong stock performance.

To be clear, the self-storage business is not recession-proof. The month-to-month lease structure commonly used with this type of property makes it easy for cash-strapped tenants to vacate during difficult times. However, with lower maintenance, operational, and turnover costs than most other property types, storage facilities tend to have rather low breakeven points and can remain profitable while riding out even the worst recessions.