This paper analyzes a class of competitive economies with production, incomplete financial markets, and agency frictions. Firms take their production, financing, and contractual decisions so as to maximize their value under rational conjectures. We show that competitive equilibria exist and that shareholders always unanimously support firms' choices. In addition, equilibrium allocations have well-defined welfare properties: they are constrained efficient when information is symmetric, or when agency frictions satisfy certain specific conditions. Furthermore, equilibria may display specialization on the part of identical firms and, when equilibria are constrained inefficient, may exhibit excessive aggregate risk. Financial decisions of the corporate sector are determined at equilibrium and depend not only on the nature of financial frictions but also on the consumers' demand for risk. Financial intermediation and short sales are naturally accounted for at equilibrium.