This is an interesting question in that it is one that involves mostly the understanding of the questioner. A similar question asked by someone who used different terminology would deserve a different answer. The one I'm providing is, I hope, compatible with the understanding of the questioner. It is not a complete explanation of the situation as would be suitable for a physics grad student. With that caveat...
The particle does not "know" of
particles around it, and should follow
a straight line.
In contemporary physics, light is considered as both a particle (the photon) and also a wave (not in the sense of the waves of electricity and magnetism, but instead in the sense of a quantum wave). A quantum wave does know about more than just the classical path.
How does a single ray of light (wave),
as part of a "wave front" know what
other rays are doing?
From the way this question is written, I'm assuming that the writer sees light as a sort of classical point particle (whose trajectories would follow "rays"), but with the added feature of being a wave (and therefore having an existence along the ray, as is necessary for a wave to have a definite energy or momentum). The question is sophisticated in that the writer understands that light has wave properties and I'll try to move that understanding a little ways further.
Light (even light that is "classical" that is, that follows Maxwell's laws of electricity and magnetism) does not follow rays. A ray is an idealization that applies only when the width of the ray is large compared to the wavelength of the light.
We could try to create a ray of light more narrow than a wavelength of the light by shining the light on a sheet of copper (or other thin opaque material) with a single hole drilled in it. If we make the hole smaller than the wavelength of light than it stands to reason that the ray that comes out of it will have a diameter smaller than the wavelength of light. But in fact, this is not what happens. Instead, light is scattered by the hole and diverges in all directions.
The effect is similar to what would happen if you had an obstruction to ocean waves but with a single hole in it. Assuming the hole is small compared to the wavelength of the ocean waves, the waves that come through it will not appear as a ray of waves, but instead will spread away from the hole in all directions.
Rather than "refraction" this feature of light is called "diffraction." The wikipedia article on diffraction ( http://en.wikipedia.org/wiki/Diffraction ) has a useful photo of water waves diffracting. Light operates the same way. I've added red lines to show the barrier and green arrows to show the direction that the waves are moving. The wave begins at the bottom left and moves towards the top right: