A bond issued by a company is less risky than a share of the same company.
A company is in bankruptcy if its assets are worth less than its obligations. In case of bankruptcy the assets are sold off in the market or by individual agreements with the creditors. Direct creditors are payed first. If there is any money left, bond owners are payed. Since the assets were worth less than the obligations, no money is left, shareholders get nothing.
So even if things turn bad, bond owners can expect reimbursement. (Unless the change in asset price was drastic they can expect a large fraction of their money to be reimbursed.) Stock owners can expect no money if the company goes bankrupt. Even worse, stock prices already go down if asset prices decrease, because the company will have less profits after meeting its debt obligations, and hence it can pay less dividends. Basically a stock owner is betting on high profits while a bond owner is betting on medium profits. During crisis most companies cannot expect high profits anymore and their prices fall accordingly. Most bond issuing companies still don't go bankrupt so bonds are less affected.