Over the past month or so, the stock market has dropped significantly, and the banking industry has been one of the big laggards. As a whole, the financial sector fell by nearly 8% during May.

While nobody likes to watch the value of their portfolio drop, times like these make for great bargain-hunting opportunities. Two banks that look like particularly good value plays are Bank of America (BAC -1.62%) and Goldman Sachs (GS -1.34%), so let's take a closer look to see which might be the better buy right now.

Woman holding hands out with A in one hand and B in the other

Image source: Getty Images.

Banks have been clobbered lately

The stock market has performed quite poorly lately, thanks to the uncertainty surrounding the trade war, as well as general recession fears. However, bank stocks have been hit worse than most other parts of the market. There are a few reasons for this but one big downward catalyst falling interest rates (a side effect of the other factors I just mentioned) could weigh on bank profits in the coming quarters. As you can see from this chart, the banking sector has underperformed the S&P 500 by about 2 percentage points over the past month.

^SPX Chart

^SPX data by YCharts.

Bank of America and Goldman Sachs are no exception and have performed particularly poorly. In fact, they are down by 12.8% and 11%, respectively, over the past month alone. Bank of America trades for just over its book value, which is extremely cheap for such a profitable institution. And, Goldman Sachs is even cheaper, with shares trading for just 84% of book.

Bank of America continues to impress

Bank of America was one of the hardest-hit banks during the financial crisis a little over a decade ago, but has completely transformed itself in the years since. Not only is Bank of America consistently profitable with a high asset quality, but the bank's results are now regularly among the best of the major U.S. banks.

For example, the bank's return on assets (ROA) reached 1.26% in the first quarter, while until recently Bank of America had struggled to get past the 1% industry benchmark. The same can be said for the bank's 57% efficiency ratio, which has resulted from effective expense management and a push toward cost-effective banking technologies.

Goldman Sachs could be a great value for long-term investors

On the other hand, Goldman Sachs is in a bit of a rut lately. In the first quarter, the bank's revenue declined in all four of its major business segments -- trading revenue was weak, investment banking revenue suffered from a lack of IPOs during the quarter, and I could go on. Plus, Goldman has a ton of legal uncertainty involving its role in the failed 1MDB Malaysian bond fund scandal.

However, most of Goldman's issues appear temporary. Obviously, the legal overhang will eventually be resolved, one way or another. Trading revenue is historically unpredictable and should still be a big revenue driver going forward. And the IPO market really picked up after the first quarter, which should help boost investment banking.

The verdict: Which is the better buy now?

To be clear, Goldman is significantly cheaper here, and there's a good reason for it. Bank of America has far less uncertainty and lingering issues than Goldman Sachs does. (This sentence would have sounded insane a decade ago.) If you're looking for the safer play of the two, Bank of America is a good value without a ton of issues to worry about.

Having said that, Goldman Sachs is starting to look too cheap to ignore. This is still an amazing institution that does a great job of making money in any market environment. As long as you have a long investment time horizon to ride out the ups and downs, and to let the bank's legal issues play out, patient investors could be handsomely rewarded for buying Goldman at its current level.