We propose a model of religious organizations which relies on the ability of such organizations and personal utility shocks. We show how religious organizations arise endogenously and characterize their features. Specifically, we find that members of the religious organization share similar beliefs and are more likely to cooperate with one another in social interactions. We identify a "spiritual" as well as a "material" payoff for members of the religious organization. Our results explain and shed light on empirical phenomena such as the effects of secularization and economic development on religious beliefs and participation, the relation between the size of the religion and the intensity of its members’ beliefs, religious segregation and religious conflicts.