We demonstrate light-emitting diodes, a vertical-cavity surface-emitting laser (VCSEL), and a photodiode fabricated using a lateral p-n junction. The lateral p-n junction is formed in a GaAs-silicon doped layer grown by molecular-beam epitaxy on a patterned GaAs (311)A-oriented substrate. Lateral p-n junctions have particular properties (i.e., small junction area, coplanar contact geometry, can be clad between electrically insulating layers, allow carrier transport in the plane of multilayer structures, etc.) that are promising for application in new devices. Light-emitting diodes exhibit good electroluminescence at room temperature for both GaAs single layers and GaAs-AlGaAs multiple-quantum-well structures. The VCSEL has electrically insulating distributed Bragg reflectors and coplanar contacts which simplify the device fabrication process. Pulsed-mode operation at room temperature was obtained with a threshold current of 2.3 mA. The light-emission spectrum has a single peak at 942 nm with a full-width at half-maximum of 0.15 nm. The photodiode design allows a reduction of the junction capacitance and an increase of the response speed. A nonoptimized device exhibited a time constant of 10 ps.