It's not unusual for the owners of privately held companies to borrow money from the company coffers once their successful businesses are generating excess cash. They believe the cash is theirs to use without triggering unwanted tax liabilities.

But such shareholder loans are risky. "In a worst-case scenario, the IRS decides that the transaction wasn't a loan, it was a corporate dividend," explains Valerie Robbins, a partner at the Washington, D.C., accounting firm of Beers & Cutler. A dividend payment is taxable to its recipient but provides no tax deduction for the corporation. "What looks good in comparison -- even though it is far from desirable -- is if the IRS decides the loan was really compensation," says Robbins, "because then the corporation gets a tax deduction, even though the recipient still owes income and social-security taxes."

To avoid those undesirable consequences -- and the tax bills, complete with back-interest charges and penalties, that inevitably accompany them -- follow Robbins's four-step blueprint:

1. At the time of a shareholder payment, document the loan in writing. You don't need a lawyer to do that, says Robbins, but the recipient and the company's owner should sign it -- twice if they are the same person.

2. Observe every formality that would accompany the signing of any other official document, including getting it witnessed. Also, keep a copy with your company's other corporate records.

3. Include a clause that names an annual interest rate to be charged for the loan. "I recommend that you pay one or two percentage points above prime, because the more you can make this transaction look like a loan, the safer you will be."

4. Make those interest payments when they come due. That's the best way of demonstrating to the IRS that the transaction is really a loan.