We study the impact of research collaborations in coauthorship networks on research output and how optimal funding can maximize it. Through the links in the collaboration network, researchers create spillovers not only to their direct coauthors but also to researchers indirectly linked to them. We characterize the equilibrium when agents collaborate in multiple and possibly overlapping projects. We bring our model to the data by analyzing the coauthorship network of economists registered in the RePEc Author Service. We rank the authors and research institutions according to their contribution to the aggregate research output and thus provide a novel ranking measure that explicitly takes into account the spillover effect generated in the coauthorship network. Moreover, we analyze funding instruments for individual researchers as well as research institutions and compare them with the economics funding program of the National Science Foundation. Our results indicate that, because current funding schemes do not take into account the availability of coauthorship network data, they are ill-designed to take advantage of the spillover effects generated in scientific knowledge production networks.