We develop an equilibrium model of industrial structure in which the organization of firms is endogenous. Differentiated consumer products can be produced either by vertically integrated firms or by pairs of specialized companies. Production of each variety of consumer good requires a unique, specialized component. Vertically integrated firms can manufacture the components they need in the quantity and type that maximizes profits, but they face a relatively high cost due to diseconomies of scope. Specialized firms can produce at lower cost, but outsourcing imposes costs due to search frictions and imperfect contracting. We study the equilibrium mode of organization when inputs are fully or partially specialized. We consider how the degree of competition in the industry, the nature of the search technology, the division of bargaining strength between intermediate and final producers, and the sensitivity of manufacturing costs to input characteristics affect the equilibrium organizational form.