The optical properties of single AlGaN nanowires grown by plasma-assisted molecular beam epitaxy have been studied by nanocathodoluminescence. Optical emission was found to be position-dependent and to occur in a wide wavelength range, a feature which has been assigned to a composition gradient along the nanowire growth axis, superimposed on local composition fluctuations at the nanometer scale. This behavior is associated with the growth mode of such AlGaN nanowires, which is governed by kinetics, leading to the successive formation of (i) a zone with strong local composition fluctuations followed by (ii) a zone with a marked composition gradient and, eventually, (iii) a zone corresponding to a steady state regime and the formation of a homogeneous alloy.