Bear markets can be scary, but that's just your emotions talking. Indeed, few investors like to see red ink, and the fear of "losing everything" is very real. However, if you can step back and see the bigger picture, market pullbacks are often great times to buy companies at relatively attractive valuations. That's the case today with Federal Realty (FRT 0.63%) and, to a lesser degree, W.P. Carey (WPC 0.36%). Here's what you need to know.

1. Small but mighty

Federal Realty owns a portfolio of around 100 outdoor shopping centers and mixed use assets. When you look at the size of its portfolio, you'll see it is one of the smaller names in the strip mall niche. And yet this company has managed to string together the longest streak of annual dividend increases in the real estate investment trust (REIT) sector. It is a Dividend King with a huge 55-year-long history of yearly dividend increases. The current yield is a generous 4%.

The big story here is that Federal Realty focuses on quality over quantity, buying well-situated properties in wealthy regions with material populations. And then it invests heavily in the assets to improve the rents it collects and the occupancy levels. When it believes it has achieved as much as it can at a property, and gets a good offer price, it sells the asset and looks for a new one. It is a process that has been successfully repeated over and over again. With its giant mixed use projects, the company spreads development over stages, so there are years of growth built into the investments.

Federal Realty's stock is off more than 20% so far this year. If you are a fan of dividend consistency, this is an opportunity you may not want to miss.

2. Opportunities abound no matter what the market brings

The next name here is W.P. Carey, which has seen its stock hold up relatively well so far in 2022. It is down about 5%, which is much better than both Federal Realty and the S&P 500 Index. Still, the yield is a pleasing 5%, and the REIT is on the cusp of becoming a Dividend Aristocrat, having raised its dividend every year since its 1998 IPO.

The big story here is that W.P. Carey is opportunistic. It's a theme that runs through its entire portfolio and investment approach. For example, management prefers to do sale/leaseback deals so it can get an insider's view of a prospective tenant's finances. That allows it to work with companies that others might feel are too financially risky to bother with. On top of that, the company's portfolio is diversified across industrial, warehouse, office, retail, and self storage assets, and a fairly large "other" category. It also includes assets in North America and Europe.

That gives W.P. Carey the bandwidth to put money to work wherever it sees the most opportunity at any given time. For example, early in the coronavirus pandemic, management started looking at industrial assets.

Although shares of W.P. Carey may not have had the biggest pullback in 2022, its business model still makes it well worth owning for dividend lovers -- and at just about any point in the market cycle, since its opportunistic approach generally means it can always find a way to grow. But don't think you are overpaying here. It still trades hands around 8% below where it was prior to the pandemic hit in 2020, even though it managed through the health scare without skipping a beat.

Taking a leap of faith

The market is off its recent lows, but with the fear of a recession still looming (gross domestic product has already fallen for two consecutive quarters, the unofficial definition of a recession), there's a good chance the bear market isn't over yet. Face the fear you are probably feeling and understand that there is never a perfect time to buy stocks. Sometimes it is better to buy great companies at fair prices and just hold them forever. Federal Realty and W.P. Carey both fall into that category, though given the pullback in Federal Realty's price, it might be the slightly more attractive name right now.