It's certainly been a lousy year for the broad market. But it's been even worse for banking stocks. While the S&P 500 is off to the tune of 21% since the end of 2021, the Dow Jones U.S. Banks index is lower by 24%. And some of the industry's stalwart stocks are nursing even bigger sell-offs, driven down by fear of a recession.

As veteran investors can attest, though, the time to step into quality names is when they're beaten down. Bank stocks are no exception to this premise.

One banking stock stands above the rest right now as a buying opportunity. That's Bank of America (BAC 3.35%)

Down for all the wrong reasons

With nothing more than a quick glance at the company's second-quarter results, you may not be surprised by the 31% setback BofA shares have suffered this year. Revenue was up just a bit from year-earlier levels for the three-month stretch in question, but per-share earnings slipped from $1.03 to $0.73. Its own rising interest expenses paired with a slowing lending market took a clear toll on the bottom line, while its investment banking business isn't quite as robust as it was at this point last year either.

And that was for the quarter ended in June, before the Federal Reserve added 1.5 percentage points of interest to its targeted federal funds rate. Those rate hikes are not only crimping the lending market, but also are pushing the U.S. economy toward a full-blown recession as well. That's the worry some economists are voicing, anyway.

Given this backdrop, Bank of America's poor showing so far this year makes sense.

Largely lost in all the noise, however, is that the bulk of this bad news is arguably already priced into BofA's stock. The analyst community is calling for a resumption of top-line growth next year, which should drive per-share earnings up to somewhere near a record-breaking $3.70. The stock's also only priced at about 8.5 times that projected profit right now. Put another way, the shares are 30% below the current consensus target price of $41.38.

That's fodder for the bullish case.

How the real world works

Still, it's tough to be excited. The banking business is highly vulnerable to the economy's worst-case scenario, and Bank of America is no exception.

This context might help: The global economy starts to recover before it becomes clear that it's recovering, and the stock market typically recovers before the economy does, despite lots of naysaying right at the beginning of the rebound.

One has to look all the way back to 2009 -- the last time the economy faced prolonged weakness -- to see this. It's now known that March 2009 was that bear market's bottom. Even several months after the rebound started, however, a sizable army of analysts and economists were still in doubt.

These pundits may have been taking their cue from the S&P 500's per-share earnings, which didn't recover in earnest until the third quarter of that year, several months after the market's big bullish reversal. Also note that the U.S gross domestic product (GDP) growth remained negative through the third quarter of 2009. GDP growth didn't become clearly positive until the first quarter of 2010, which nobody would have known for sure until the second quarter of 2010, when those numbers were first reported. Investors who had the guts to jump in when it was a little uncomfortable to do so, though, were well rewarded by BofA's big run-up beginning several months earlier.

Moral of the story? It's all too easy to sit on the sidelines for too long while waiting on irrefutable evidence of an economic rebound. At some point you'll have to take a calculated risk, having faith that the economy will eventually recover and bring bank stocks with it when it does.

Bank of America's survived worse

Don't misread the message. The market may or may not be near the bottom, and the corresponding economic recovery could be months away -- or longer. That's why you'll want to look elsewhere if you need certainty in this environment because like all banks, Bank of America is highly subject to economic cycles.

If you're focused on the long term and can stomach a bit of volatility, though, know that it's not as if BofA hasn't been in this situation, and overcome it, before. Indeed, much of this year's apparent fiscal weakness is just the result of a banner 2021 that ended up being a tough act to follow.

Bank of America is expected to shrug off its current fiscal headwind in 2023.

Data source: Thomson Reuters. Chart by author. Revenue figures are in millions of dollars.

Bottom line? Bank of America remains a best-of-breed stock, and makes for particularly smart exposure to the financial sector now that you can buy it at a deep discount. You just have to look past all the noise related to this year's pullback to see it.