Buying stocks when the market is down can be a tremendous way to supercharge your investment portfolio. Real estate investment trusts (REITs) are especially attractive since dividend yields and price have an inverse relationship.

When share prices drop but dividend payments remain the same, the dividend yields go up, making REITs the ideal bargain buy.

Prologis (PLD -1.15%) and Digital Realty Trust (DLR 0.12%) are two high-quality REITs that are trading at a notable discount compared to recent highs. Here's a closer look at each company and why investors may want to load up on these discounted stocks.

1. Dominating the industrial industry

Prologis is one of the largest REITs by market capitalization and the largest industrial operator across the globe. The company, which buys, develops, and leases industrial real estate like warehouses and distribution centers, has interest or ownership in over 4,700 properties in 19 countries.

A limited supply of industrial space and the growing need for industrial real estate within the e-commerce and retail sector has pushed rental growth and occupancy to record highs for the REIT since 2020. Investors feared that potential recessionary impacts hurting would hurt industrial demand. But Prologis' latest earnings report eased concerns as strong demand continues.

Occupancy as of the second quarter of 2022 was 97.6% and its net effective rent change, or rental growth, rose by over 45% in the last year. Not to mention the company is extremely well funded with over $5.2 billion in cash and cash equivalents, which is more than enough to cover its current debt obligations, and it's expanding like crazy. It's currently in the process of acquiring Duke Realty (DRE), a smaller but fast-growing industrial REIT, and is expecting to spend an additional $1.2 to $1.7 billion in acquisitions this year.

Prologis' incredible performance since the start of the pandemic has pushed its share price up 64% over the past three years. But recent market volatility has put it on sale, down 24% from recent highs. Given that its price is trading at a fair valuation of 17 times its funds from operations (FFO) and it's paying just over a 2% dividend yield, it's a great bargain buy right now.

2. Short-term headwinds but long-term opportunities

Data centers make up a complex industry, but they play an increasingly important role in our tech-driven economy. Nearly everything we do today, such as interacting on social platforms, online schooling, using cloud-based services, streaming, e-commerce sales, and even augmented reality, relies on data centers to operate. 

While there are several options for investing in data centers, Digital Realty Trust is one of the few remaining data center REITs and among one of the largest data center operators in the world. As of Q2 2022, the REIT had interest and ownership in nearly 300 data center facilities that help store and aggregate digital data for over 4,000 customers on six continents.

The REIT has been down 26% from recent highs thanks to general market volatility but also due to several short-term headwinds in the data center industry -- including supply chain challenges which have made it difficult to source important parts for the operation and development of its centers, but also currency changes.

Its latest earnings showed very lackluster growth, with revenues up by 1% quarter over quarter and 4% year over year, while its FFO and net operating income (NOI), which are both important metrics for assessing a REIT's profitability, are down from the year prior, which isn't great.

But if we think long-term, 10 to 15 years from now, there's no doubt that data centers will continue to see growing demand and need for data storage space as more technological advancements are made. The necessity-based role it plays is why I believe data centers are one of the biggest investment opportunities of the coming decade and why it's a great buy, especially given that share prices are down today.

Digital Realty Trust's price-to-FFO ratio is around 20, which means it's fairly priced by REIT standards. Plus, the REIT boasts 17 years of consecutive dividend increases, with its dividend yield being 3.65%, over double that of the S&P 500 today.