Abstract Multi-color (B, V, Rc, Ic) CCD photometric light curves of the contact binary V502 Oph are analyzed using the Wilson–Devinney program. The solutions reveal that V502 Oph is a W-subtype contact (f = 35.3%) binary system. The temperature difference between its two components is 240 K and the more massive star has a lower surface temperature. A cool spot is added in our model to account for the light curves’ asymmetry (O'Connell effect) and a third light is detected for the first time in the light curves’ modeling. Combining the orbital inclination (i = 76 $_{.}^{\circ}$4) with the published mass function of V502 Oph, the absolute physical parameters of the two components are determined, which are M1 = 0.46(±0.02) M⊙, M2 = 1.37(±0.02) M⊙, R1 = 0.94(±0.01) R⊙, R2 = 1.51(±0.01) R⊙, L1 = 1.13(±0.02) L⊙, and L2 = 2.49(±0.03) L⊙. The formation and the evolutionary status of V502 Oph are discussed. All photoelectric and CCD times of light minimum about V502 Oph are gathered and its orbital period variations are analyzed. The results show that the orbital period of V502 Oph is decreasing continuously at a rate of dP/dt = −1.69 × 10−7 d yr−1,which corresponds to a conservative mass transfer rate of dM2/dt = −3.01 × 10− 8 M⊙ yr−1. The light-travel time effect is due to the presence of a close-in tertiary component with a period of P3 = 18.7 yr and an amplitute of 0.00402 d. V502 Oph is an ideal target to test the formation and evolution theories of binary and multiple systems in which the light curves, the O − C curve and spectroscopic observations are comprehensively researched.