As shares of real estate investment trusts have soared, investors need to target quality companies.