It has been a tough year for stocks. At times like this, one of the best things you can do is invest in quality companies that can perform in different market conditions. One way to find these companies is by looking at their dividend history. Companies that consistently raise dividends over decades have a proven track record of good cash management amid multiple recessionary times.

Over the last 48 years, there have been seven bear markets in the U.S. Below are three companies that have boosted their dividends every year during that period.

A happy person is holding up cash.

Image source: Getty Images.

1. This company's advantage helped it raise its dividend for 49 consecutive years 

S&P Global (SPGI 0.93%) has a distinct advantage -- because of high barriers to entry, competitors have a hard time making inroads into its signature business.

The company issues credit ratings to companies around the globe. It's a crucial part of fixed-income markets that lets investors know how risky a company's debt is if they choose to buy it. Regulations make it difficult for new companies to enter the market. As a result, S&P Global and Moody's Corp. dominate with a combined 80% market share.

S&P Global's advantage is why it has such strong gross profit margins -- which have averaged 70% over the past decade -- and excellent free cash flow, which has grown 15% annually over the same period. 

The company has increased its dividend for 49 consecutive years, which is one year away from the coveted Dividend King title. It currently yields investors 1.1%, and its payout ratio -- total dividends paid out divided by net income -- is 23%, suggesting the company should have no problem covering its dividend payments.

Half of S&P Global's revenue comes from rating credit, which has slowed considerably this year. According to the Securities Industry and Financial Markets Association (SIFMA), U.S. corporate bond issuance was down more than 23% through August compared to last year. While its rating business revenue declined 20% in the first six months compared to last year, S&P Global's analytics and other businesses made up the slack, with revenue from these sources growing 83%. 

S&P Global enjoys a considerable competitive advantage, and its other income streams make it a resilient business that should have no problem paying its dividend in this bear market.

2. This steady earner has increased its dividend for 62 years in a row

Insurance companies can make excellent investments. These companies can consistently bring in cash flow and adapt quickly to inflationary pressures. Cincinnati Financial (CINF 0.83%) writes insurance policies covering property, homeowners, and auto insurance.

The company struggled from 2008 to 2011, when its combined ratio, the ratio of claims and expenses to premiums collected, was above the industry average. However, good capital management allowed the company to keep increasing its dividend during a difficult time in the market. Under its current chief executive officer, on the job since 2011, the company has posted an industry-beating combined ratio every year during the past decade. The combined ratio measures the amount by which premiums collected exceed claims paid.  

Stellar capital management enabled Cincinnati Financial to navigate multiple recessions, and this is why it has increased its annual dividend for 62 years straight. It's also in a position to adapt quickly to rising inflationary pressures. This year its written premiums have grown 13% as it adapts to higher prices. With its 2.82% dividend yield and history of raising dividends, Cincinnati Financial is another dividend stock you can trust during the bear market.

3. This bank's acquisitions led to 48 consecutive years of dividend increases

United Bankshares (UBSI 1.34%) operates regional banks across the mid-Atlantic, including Virginia, Washington D.C., West Virginia, Ohio, Maryland, and the Carolinas. The bank has rewarded shareholders for years, increasing its dividend payout for 48 consecutive years.

The bank has done an excellent job of growing through acquisitions to build up its deposit base. Since 1982, United Bankshares has acquired 33 regional banks throughout the Southeast and mid-Atlantic regions of the U.S. 

The bank is well positioned for rising interest rates. It expects net interest income for this year to come in between $845 million and $865 million, up from earlier this year when it predicted net interest income to be between $780 million and $800 million. 

United Bankshares has held up well this year, up almost 2%, while the S&P 500 declined more than 24%. Its 3.9% dividend yield and history of raising dividends through difficult times make United Bankshares another dividend stock you can add today to ride out the bear market.