Uniform CdS/ZnO core/shell nanowires are hydrothermally synthesized using a two-step process and assembled into a photodetector and a NO2 optoelectronic sensor for the first time. The corresponding photodetector exhibits a fast, reversible, and stable optoelectronic response with a rise time of ∼26 ms, a decay time of ∼2.1 ms and a stability of over 5 months. The remarkable photosensitivity and fast photoresponse are attributed to the formation of a heterojunction structure between CdS and ZnO, which greatly inhibits the recombination of photoinduced electrons and holes. The CdS/ZnO core/shell nanowires also show an excellent visible-light-activated gas sensing performance towards ppb-level NO2 at room temperature. The responses range from 6.7% to 337% toward NO2 concentrations of 5 to 1000 ppb. It is found that the sensitivity of the NO2 sensor is dependent on the illuminated light intensity with a maximum value at 0.68 mW/cm2. The sensing mechanisms of the CdS/ZnO nanowires under visible-light irradiation and the influence of light intensity are also discussed. The present CdS/ZnO core/shell nanowire not only benefits the fabrication of efficient photodetectors, but also makes the instant, optically controlled sensing of ppb-level NO2 gas possible.