Real estate has historically been a great investment. Rents and prices tend to rise with inflation, and consistent cash flows make it a favorite among income investors. But even the best historical records can't overcome prices that are too high.

Here's why investors should think twice before paying up for real estate investment trusts like Realty Income (O 1.94%).

Great company, terrible valuation
Finance is all about pricing risk. U.S. Treasuries are seen as risk-free -- the government can just print more money to service and repay its debts. All other investments carry risk, and thus they must provide for higher returns than the rate on U.S. Treasuries.

High-yield stocks like REITs are invariably priced based on their yields relative to U.S. Treasuries. When U.S. Treasury yields are high, REIT yields will be even higher. When U.S. Treasury yields are low, REIT yields will be low.

Blue chip REITs with established, successful records like Realty Income trade at yields just slightly above the U.S. Treasury yield. Investors perceive Realty Income's growing dividend as only modestly more risky than U.S. Treasuries.

It's probably a fair assessment -- Realty Income has an excellent record and is a dominant player in its industry. It has access to incredible store-level data, giving it more insight into the real estate market than most of its peers. Its balance sheet is solidly constructed. The point I'm trying to make is that its earnings, and its future, are probably more certain than your average publicly traded stock.

But that's not to say it's without risk, particularly interest rate risk. As yields on U.S. Treasuries have come down, investors are willing to pay higher and higher prices for Realty Income's monthly dividends. Share prices have gone up, and thus its dividend yield has come down.

A walk down history
Realty Income currently trades at about 20 times annualized funds from operations, giving it a FFO yield of roughly 5%. That compares favorably to a 10-year U.S. Treasury yield that sits at around 1.7%, the lowest rates have been since 2013.

Speaking of 2013, it was during another decline in interest rates that Realty Income shares reached similarly high levels of more than $55 per share. Just weeks later, the Federal Reserve would announce its intention to taper asset purchases, yields on U.S. Treasuries went up, and Realty Income's share price cratered.

Here's a chart of U.S. Treasury yields (blue) and Realty Income's share price (red). You'll notice that the inverse relationship is strong -- the company's share price moves in the opposite direction of the Treasury yields.

While I firmly believe that Realty Income is one of the best-managed REITs on the market, and probably one of the lowest-risk, high-yield stocks, I think that its current valuation leaves a lot to be desired. If you buy today, you'll have to stomach the potential for losing several years' worth of dividends in capital losses from just a modest increase in interest rates.

Rather, I'd seek to enter at a more attractive valuation. At 17 times annualized third-quarter funds from operations -- a roughly 15% hair cut to Friday's closing price -- you'd have a much better margin of safety. And it's likely that you'll get the opportunity to buy at that price before giving up too much in the way of lost dividends.