Supplemental light is often used in fruit production, but few studies have been conducted on pitaya. In this study, supplemental blue light was applied to pitaya for four hours each night in the field from flowering to fruit ripening to examine changes in peel and pulp physicochemical parameters and metabolites. Blue light treatment significantly increased fruit weight, improved fruit firmness by increasing pectin content and retarding hemicellulose degradation, and enhanced antioxidant enzyme activity. Blue light had minor effects on primary metabolites but more pronounced effects on volatiles. By affecting alanine, aspartate and glutamate metabolism, blue light treatment resulted in significant fruit growth, increased accumulation of bioactive ingredients in the peel, and significantly altered the accumulation of flavor-associated volatile compounds, such as organic acids, esters and terpenes in the pulp. Our results provide an important reference for improving the yield and quality of pitaya production using supplemental light in the field.