If the bear market has you worried about where to invest, there are some sectors you can focus on that have the potential to outperform. Healthcare, for instance, could be a solid place to invest as the economy returns to normal and hospitals are no longer deferring procedures. And while retail stocks may not seem terribly safe, those offering goods at discounted prices could outperform.

Two stocks within those categories worth considering right now are Johnson & Johnson (JNJ 0.82%) and Ross Stores (ROST 0.32%).

1. Johnson & Johnson

Healthcare giant Johnson & Johnson reported its most recent earnings numbers last week, and they proved to be resilient. Sales of just over $24 billion for the three-month period, end June, rose by 3% year over year. And if not for the impact of foreign currency, those numbers would be even better; operationally, the company's sales rose by 8%. Johnson & Johnson anticipates operating sales growth of between 6.5% to 7.5% for the full year.

The strength of the business is its diversification as all of its major segments (consumer health, pharmaceutical, and med-tech) generated positive growth numbers during the period. And half of its revenue comes from markets outside the U.S.

Johnson & Johnson's business will, however, look a bit different next year as it is spinning off its consumer business. That will mean less revenue and diversification, but that area of its business generated $3.8 billion in sales this past quarter -- making it the company's smallest segment -- and it also reported the smallest organic growth at 2.3% year over year. Plus, given the legal headaches that the consumer business has with talc lawsuits, it'll likely be a net positive for the company in the end. 

During the last prolonged recession in 2008 and 2009, Johnson & Johnson's stock soundly outperformed the markets. While the healthcare stock declined more than 10% during the downturn, that was still better than the near-40% drop the S&P 500 endured.

That doesn't mean that trend will continue if there's another recession, but with a strong and diverse business, Johnson & Johnson could be one of the safer places to invest in today. Year to date, the stock is up over 1%, which is a modest but still market-beating return thus far. An additional incentive to buy and hold the stock is that it's also a Dividend King, having raised its dividend payments for more than 50 consecutive years.

2. Ross Stores

Ross has around 1,900 stores across the country, and this year it plans to add another 100 locations. The allure of its retail stores is that they offer name-brand apparel that is between 20% and 70% lower than what consumers will find at department stores. So in the midst of the worst inflation seen in decades, Ross' stores could offer consumers a way to keep their costs down and lessen the blow to their budgets.

Like Johnson & Johnson, Ross was a market-beating stock during the Great Recession. Not only did it outperform, but it also generated positive returns of 50%. But things have been much different in 2022 with Ross' 28% decline being far worse than the S&P 500's more modest fall of 17%. Part of the reason is likely to do with the bearish outlook on retail stocks. Target's rising inventory levels may have spooked some investors as that stock's decline of 32% this year is even worse.

Ross is facing challenges as well; its sales totaled $4.3 billion and were down 4% year over year in the period ended April 30. And the company is projecting that its top line will fall between 4% and 6% for the current quarter. CEO Barbara Rentler is taking a conservative outlook given the uncertainty in the economy right now, which is a sound strategy. Investors should welcome some conservatism because it doesn't set the company up for lofty targets that might be difficult to reach. And at the same time, it could also make it easier for Ross to deliver better-than-expected numbers.

Although shares are down big right now, Ross has the potential to outperform in the second half of this year as rising inflation could bring in more cash-strapped shoppers to its stores. And unlike big-box retailer Target, which needs to load up on certain inventory for the busy holiday season, Ross' customers familiar with the treasure-hunt experience know not to expect too much consistency from its offerings -- and that can play to its favor as it stocks its stores with what makes sense financially.

Trading at 18 times earnings, Ross isn't a dirt cheap buy (Target trades at 13 times its profits), but it's a stock that has the potential to be a great investment right now.