Inherited retinal degenerative diseases are a clinically promising focus of adeno-associated virus (AAV)-mediated gene therapy. These diseases arise from pathogenic mutations in mRNA transcripts expressed in the eye's photoreceptor cells or retinal pigment epithelium (RPE), leading to cell death and structural deterioration. Because current gene delivery methods require an injurious subretinal injection to reach the photoreceptors or RPE and transduce just a fraction of the retina, they are suitable only for the treatment of rare degenerative diseases in which retinal structures remain intact. To address the need for broadly applicable gene delivery approaches, we implemented in vivo-directed evolution to engineer AAV variants that deliver the gene cargo to the outer retina after injection into the eye's easily accessible vitreous humor. This approach has general implications for situations in which dense tissue penetration poses a barrier for gene delivery. A resulting AAV variant mediated widespread delivery to the outer retina and rescued the disease phenotypes of X-linked retinoschisis and Leber's congenital amaurosis in corresponding mouse models. Furthermore, it enabled transduction of primate photoreceptors from the vitreous, expanding its therapeutic promise.