The formation of epithelial lumina is a fundamental process in animal development. Each ommatidium of the Drosophila retina forms an epithelial lumen, the interrhabdomeral space, which has a critical function in vision as it optically isolates individual photoreceptor cells. Ommatidia containing an interrhabdomeral space have evolved from ancestral insect eyes that lack this lumen, as seen, for example, in bees. In a genetic screen, we identified eyes shut (eys) as a gene that is essential for the formation of matrix-filled interrhabdomeral space. Eys is closely related to the proteoglycans agrin and perlecan and secreted by photoreceptor cells into the interrhabdomeral space. The honeybee ortholog of eys is not expressed in photoreceptors, raising the possibility that recruitment of eys expression has made an important contribution to insect eye evolution. Our findings show that the secretion of a proteoglycan into the apical matrix is critical for the formation of epithelial lumina in the fly retina.