We develop a model of R&D competition and collaboration in which individual firms carry out independent in-house research and also undertake joint research projects with other firms. We examine the impact of collaboration on in-house research and explore the circumstances under which a hybrid organization of R&D which combines the two is optimal for firms and society. We find that investments in independent research and in joint research are complementary: an increase in the number of joint projects also increases in-house research. Firm profits are highest under a hybrid organization if the number of firms is small (less than 5) while they are highest with pure in-house research if the number of firms is large (5 or more). However, social welfare is maximized under a hybrid organization of R&D in all cases. Our analysis also yields new results on the role of cooperative R&D. We find that non-cooperative decision making by firms leads to larger R&D investments and higher social welfare than fully cooperative decision making. However, a hybrid form of decision making where there is bilateral cooperation in joint projects and non-cooperative decision making in in-house research yields the highest level of welfare in concentrated industries.