Depending on your relationship with the business, your payment of the debt will either be a personal bad debt or a business bad debt. A personal bad debt is deductible as a short term capital loss. A business bad debt is deductible as an ordinary loss.
Below is an excerpt from IRS Publication 535 Business Expenses and a link to the publication itself.
Business loan guarantee. If you guarantee a debt that subsequently becomes worthless, the debt can qualify as a business bad debt if all the following requirements are met.
You made the guarantee in the course of your trade or business.
You have a legal duty to pay the debt.
You made the guarantee before the debt became worthless. You meet this requirement if you reasonably expected you would not have to pay the debt without full reimbursement from the issuer.
You receive reasonable consideration for making the guarantee. You meet this requirement if you made the guarantee in accord with normal business practice or for a good faith business purpose.
Jane Zayne owns the Zayne Dress Company. She guaranteed payment of a $20,000 note for Elegant Fashions, a dress outlet that is not a "related person." Elegant Fashions is one of Zayne's largest clients. Elegant Fashions later defaulted on the loan. As a result, Ms. Zayne paid the remaining balance of the loan in full to the bank.
She can claim a business bad debt deduction only for the amount she paid, since her guarantee was made in the course of her trade or business for a good faith business purpose. She was motivated by the desire to retain one of her better clients and keep a sales outlet.
Deductible in the year paid. If you make a payment on a loan you guaranteed, you can deduct it in the year paid, unless you have rights against the borrower.
Rights against a borrower. When you make payment on a loan you guaranteed, you may have the right to take the place of the lender. The debt is then owed to you. If you have this right, or some other right to demand payment from the borrower, you cannot claim a bad debt deduction until these rights become partly or totally worthless.