Optical properties of the GaNxAs1−x layers grown on (001) GaAs substrates by molecular beam epitaxy have been studied. The samples can be classified into three categories with respect to the concentration of N, as determined by x-ray diffraction and secondary-ion mass spectrometry: (i) with doping nitrogen concentration, (ii) with average content of N less than 30 %, and (iii) with x close to 100 %. From optical measurements of photoluminescence and Raman scattering, combined with analysis of x-ray diffraction spectra, different phases are observed in the GaNxAs1−x layers: GaAs, GaN and the solid ternary solution GaNxAs1−x. We have estimated the fundamental band-gap energy in the GaNxAs1−x alloy with low nitrogen concentration (up to x = 0.04) from absorption measurements, and in GaNxAs1−x with low arsenic concentration (up to 1−x = 0.04) - from photoluminescence spectra. An analysis of the dependence of the experimental values of the GaNxAs1−x band-gap energy on the nitrogen composition indicates a constant bowing parameter b as large as b = -18 eV.