We have measured the photoresponse of two purple nonsulfur bacteria, Rhodobacter sphaeroides and Rhodospirillum centenum, under defined conditions in a light beam propagating at 90 degrees to the optical axis of the microscope. This beam presented cells with a steep gradient of intensity perpendicular to the direction of propagation and a shallow gradient in the direction of light propagation. R. centenum, a species that reverses to change direction, accumulated in the light beam, as expected for a "scotophobic" response, while R. sphaeroides, which stops rather than reverses, accumulated outside the light beam. We also compared the behavior of liquid-grown R. centenum, which swims by using a single polar flagellum, to that of surface-grown R. centenum, which swarms over agar by using many lateral flagella and has been shown to move as colonies toward specific wavelengths of light. When suspended in liquid medium, both liquid- and surface-grown R. centenum showed similar responses to the light gradient. In all cases, free-swimming cells responded to the steep gradient of intensity but not to the shallow gradient, indicating they cannot sense the direction of light propagation but only its intensity. In a control experiment, the known phototactic alga Chlamydamonas reinhardtii was shown to swim in the direction of light propagation.