Ostrinia furnacalis is a disreputable herbivorous pest that poses a serious threat to corn crops. Phototaxis in nocturnal moths plays a crucial role in pest prediction and control. Insect opsins are the main component of insect visual system. However, the inherent molecular relationship between phototactic behaviour and vision of insects remains a mystery. Herein, three opsin genes were identified and cloned from O. furnacalis (OfLW, OfBL, and OfUV). Bioinformatics analysis revealed that all opsin genes had visual pigment (opsin) retinal binding sites and seven transmembrane domains. Opsin genes were distributed across different developmental stages and tissues, with the highest expression in adults and compound eyes. The photoperiod-induced assay elucidated that the expression of three opsin genes in females were higher during daytime, while their expression in males tended to increase at night. Under the sustained darkness, the expression of opsin genes increased circularly, although the increasing amplitude in males was lower when compared with females. Furthermore, the expression of OfLW, OfBL, and OfUV was upregulated under green, blue, and ultraviolet light, respectively. The results of RNA interference showed that the knockout of opsin genes decreased the phototaxis efficiency of female and male moths to green, blue, and ultraviolet light. Our results reveal that opsin genes are involved in the phototactic behaviour of moths, providing a potential target gene for pest control and a basis for further investigation on the phototactic behaviour of Lepidoptera insects.