Disclaimer: I am not qualified to answer this question, because this is related to the standard model (High Energy Physics) but I would try to answer this as close as possible.
Since we are in the regime of quantum particles I would like to refine the definitions of the terms you used.
Touch: If we go to the microscopic scale of things, there's nothing like "touching" by things. Particles interact through the force carriers. When your finger touches something, the molecules of your finger exert residual electromagnetic force (which will present at the boundary of any material) to molecules of that something. Also, remember molecules don't exert force, apparent charge in the molecule does. This force is what you feel like a touch. You'll say that you should not feel the surface of any material if you are not exactly touching them. You would have been correct if all surfaces had the same shape/texture, but they don't. Due to irregularities at the millimetre scale, you feel differently after touching the different surfaces, even if they have the same molecular structure.
Mass-less: (from wiki) a massless particle is an elementary particle whose "invariant/rest" mass is zero. The two known massless particles are both gauge bosons: the photon (carrier of electromagnetism) and the gluon (carrier of the strong force).
So, light is a group of photons, when we see it. As stated above, that photons are force carriers, that is, they produce the "touching" effect between materials. Now, a light getting incident on an interface jiggles the electrons at the interface. Now, how exactly this jiggling happens will decide the direction of the new photon beam. You should ask, why this jiggling changes at different interfaces. This could vary from treatment to treatment, as in, the quantum theory will give you a little different answer from electromagnetic treatment. But the core point is that these molecules at the interface don't jiggle independently but they have a constraint motion due to their neighbouring atoms/molecules. And since this neighbour interaction changes from material to material, you'll have different wavelengths and hence different directions of photons beams.