A bear market can bring down prices on all stocks, but that doesn't mean investors should buy all stocks when they dip. Warren Buffett -- one of the most successful investors of all time -- once said that you could see who's been swimming naked when the tide goes out. In other words, a bear market can expose weak companies -- some may never again approach their former highs.

Cybersecurity company CrowdStrike Holdings (CRWD -0.38%) has felt the carnage; the stock has fallen nearly 40% from its peak. However, don't let fear freeze you in your tracks. This is a stock to buy the dip on; here is why it can help your portfolio in the short and long term.

The short-term opportunity

A long-term investor should celebrate when a business keeps getting stronger, but the share price keeps falling. The stock market can be pretty irrational in the short term. Simply put, Wall Street is scared now, and investors are selling. CrowdStrike has been no different; shares are down 40% from their high, and the stock's price-to-sales (P/S) ratio is near its lowest point outside of the COVID-19 market crash in 2020.

CRWD PS Ratio Chart.

CRWD PS Ratio data by YCharts.

It would be understandable if a recession or rising rates hurt CrowdStrike's business, potentially justifying the selling that has taken place. But the reality is that CrowdStrike's business is stronger than ever. You can see above that the company is growing revenue without a hitch in its step; it increased its customer count by 51% year over year in the quarter ending July 31, 2022, adding a record 1,741 net new subscriptions in the quarter.

Cybersecurity failures can be extremely costly. In fact, IBM estimates that the average breach costs U.S. enterprises $9.44 million. Whether there's a recession or not, security will likely remain a high priority for businesses. CrowdStrike is part of a new generation of cybersecurity technology, operating through the cloud to provide real-time protection against existing and unknown threats. Older technology like antivirus software relies on systemwide updates, meaning it won't detect anything it hasn't seen before. It may take time, but CrowdStrike's continued growth could eventually mean the stock roars back strong when the next bull market begins.

Looking further out

Don't get me wrong; growth is an essential ingredient in the recipe for investment returns. But turning a profit is just as important, and some companies grow for many years without ever making money. Fortunately, it doesn't look like CrowdStrike will have that issue. You can see below that the business is already generating significant cash profits despite remaining a high-growth company.

CRWD Free Cash Flow Chart.

CRWD Free Cash Flow data by YCharts.

CrowdStrike is converting $0.25 of every revenue dollar into free cash flow, which is discretionary cash profit that can either be returned to shareholders or go to the balance sheet as cash. The company's still in growth mode, so money is accumulating on the balance sheet; CrowdStrike has roughly $1.6 billion in cash net of debt.

Cash profits will eventually play more of a factor in the stock's investment returns. This might mean an acquisition down the road, something CrowdStrike has already done to expand its offerings. It could eventually repurchase shares to boost its earnings per share (EPS). Free cash flow is essentially the blood that keeps a company alive, so seeing so much this early in CrowdStrike's growth days is an excellent sign for long-term investors. The company is not yet profitable from a net income standpoint due to stock-based compensation, but that's a non-cash expense that should become a smaller piece of the puzzle as CrowdStrike keeps growing. Net income is negative $173 million over the past four quarters versus $543 million in free cash flow. In other words, CrowdStrike is essentially choosing to accumulate cash instead of showing a profit at this point.

How should you approach CrowdStrike stock?

Knowing when the market will bottom and turn around is no different from flipping a coin; nobody can predict the future, no matter how hard some try to convince you. That's why a dollar-cost average strategy can help you invest intelligently. Using this strategy, you buy small chunks of a stock and slowly build your position over time. If the stock heads higher, great! You've already begun owning shares. A lower stock price means you're getting more bang for your buck -- it's a win-win for investors.

CrowdStrike seems poised for long-term success, so building a position in this bear market could look like a great move. Have a plan, diversify your portfolio, and stick to companies with solid fundamentals. If you do this, you'll most likely do very well over the long term.