We report optical studies on AlxGa1-xN alloy layers across the full composition range. The series of alloy layers was grown on (111)-oriented silicon substrates using gas-source molecular beam epitaxy. From reflectance measurements, we determine the composition dependence of the energy gap to be Eg = 3.42+ 1.18x + 1.56x2, in good agreement with previous work. By combining Fourier transform infrared and Raman spectroscopy studies, we determine the composition dependence of phonons having A1(TO), E1(TO), E22, A1(LO), and E1(LO) symmetry. The longitudinal optic phonons exhibit one-mode alloy behavior. Two-mode alloy behavior is observed for all transverse optic and the E22 phonons (i.e., each mode has AlN-like and GaN-like branches). All phonons are seen to blueshift with increasing x. The influence of stress on the phonon energies is discussed.