We model dynamic investment, financing and default decisions of a firm, which begins its life with a collection of growth options. The firm exercises them optimally over time, and finances the costs of investment by trading off tax benefits of debt with both distress costs and agency costs of debt. Conflicts of interests between equityholders and various classes of debtholders are managed through optimal choice of investment triggers, capital structure, and default triggers. We show that (i) existing debt may significantly distort investment decisions (debt overhang and risk shifting); (ii) anticipating distortions induced by debt, firms with more growth options on average have lower leverages, consistent with empirical evidence; (iii) the seniority structure of debt has significant effects on the firm's default, leverage, and investment decisions, when existing debt is exogenously given; (iv) when future growth options are anticipated, the firm optimally chooses its initial investment and leverage decisions, which substantially mitigate the anticipated endogenous debt overhang, and make debt seniority structure much less relevant.