Many people have heard that corporate income is taxed twice: once to the corporation itself and then a second time when earnings are paid out to the corporation's owners (shareholders). This is true only for earnings paid out to shareholders in the form of dividends -- that is, profits paid by the corporation to its shareholders in return for their investment in the company.
In practice, this sort of double taxation seldom occurs in a small corporation. The reason is simple: Shareholders rarely pay themselves dividends. Instead, they work for the corporation and pay themselves salaries and bonuses. Because the corporation can deduct salaries and bonuses as ordinary and necessary business expenses, it doesn't have to pay corporate tax on them. (Dividends, on the other hand, are not a tax-deductible corporate expense, so both the corporation and the shareholder must pay tax.) As long as you work for your corporation, even in a part-time or consulting capacity, you can avoid double taxation by taking home profits in the form of a salary and bonuses rather than dividends.
For more information, see Nolo's article How Corporations Are Taxed.