Morphologically diverse eyes have evolved numerous times, yet little is known about how eye gain and loss is related to photic environment. The pteriomorphian bivalves (e.g., oysters, scallops, and ark clams), with a remarkable range of photoreceptor organs and ecologies, are a suitable system to investigate the association between eye evolution and ecological shifts. The present phylogenetic framework was based on amino acid sequences from transcriptome datasets and nucleotide sequences of five additional genes. In total, 197 species comprising 22 families from all five pteriomorphian orders were examined, representing the greatest taxonomic sampling to date. Morphological data were acquired for 162 species and lifestyles were compiled from the literature for all 197 species. Photoreceptor organs occur in 11 families and have arisen exclusively in epifaunal lineages, that is, living above the substrate, at least five times independently. Models for trait evolution consistently recovered higher rates of loss over gain. Transitions to crevice‐dwelling habit appear associated with convergent gains of eyespots in epifaunal lineages. Once photoreceptor organs have arisen, multiple losses occurred in lineages that shift to burrowing lifestyles and deep‐sea habitats. The observed patterns suggest that eye evolution in pteriomorphians might have evolved in association with light‐guided behaviors, such as phototaxis, body posture, and alarm responses.