Various electrical components used in optical communications include a waveguide and a grating along the waveguide through which light is directed out of the waveguide. For example, grating-surface-emitting lasers such as described in the article of Gary A. Evans et al, entitled "Two Dimensional Coherent Laser Arrays Using Grating Surface Emission", published in IEEE JOURNAL OF QUANTUM ELECTRONICS, Vol. 25, No. 6, June 1989, pages 1525-1538, comprise a substrate having therein an active region wherein light is generated when a voltage is applied thereacross. The active region includes a waveguide along which the generated light travels. Across the waveguide at one end of the active region is a grating which directs some of the light out of the substrate through a surface of the substrate at an angle to the surface. Various techniques are used to adjust the angle at which the light is emitted from the waveguide including adjusting the period of the grating. However, it is often desirable to be able to change the angle of emission of the light beam during the operation of the device, or to be able to scan the emitted light beam.