Agency costs arise as a consequence of separation of control and financing decisions in a firm. They are one of the important factors which reduce the market value of a firm. The paper is devoted to agency problems related to the conflict between stockholder-manager and the bondholder-creditor. As the agency costs are extremely difficult to be measured directly, a mathematical model of a firm and contingent claims analysis are used. Both the possibility of making decisions on investment and on abandonment of activity are assigned the form of real options. This approach enables to calculate the agency costs of debt and indicate factors determining their level. Debt financing in a firm leads to overinvesting and risk-shifting two important signs of agency conflict of debt. For the base-case parameters the agency costs are small, ranging from 0,6% to 1,16% of firm value, but when the level of debt increases they rise quickly. Moreover, the more effective are the investment projects made by the firm and the higher its tax payments, the higher are the agency costs of overinvestment. An interesting effect results from changing such parameters as risk of price volatility and the convenience yield. The analysis shows that both high-growth firms and low- growth mature ones are more resistant to agency costs related to overinvestment, though the source of this resistance is different.