Distance between two light rays of a beam in a material. Why is it that the distance between two light rays changes as they pass from one material to another?   
It must have something to do with the change in refractive index, but to me it seems the ''ends'' of the beam are refracted by equal amounts.  
Can you explain this? See the picture below.

 A: The effect you are describing is actually used everyday in laser systems to reshape light beams. Most the time, the raw spatial mode coming from a laser diode is not round (gaussian) but squeezed along one direction. People use prism to squeeze or expand laser light beam in a given direction.
Yes, it has to do with the change in refractive index which does not conserve the propagation direction, the incidence angle and refracted angle are different. However, the projection length (the intersection of the beam with the interface) does not change. It is therefore the combined effect of the initial geometrical cross-section of the beam plus the deviation angle.

A: Hold the meter scales on the adjacent of the two rays (shown in your diagram) in parallel to them. If the two rays bend at the same value of the meter scale, then the rays remain at the same distance after refraction as they were before refraction.   
But, in your diagram the two rays bend at the different values of the meter scale, so you observe the distance between them to be greater after refraction (if the speed of light is lesser in the second medium) or lesser after refraction (if the speed of light is greater in the second medium).      
You can observe that   
$\color{green}{\checkmark}$ the distance between two oblique rays remain the same if the refractive index of the two medium is same, in other words, if the angle of refraction if equal to angle of incidence.   
In reflection, angle of incidence is always equal to angle of reflection. Thus, you will always find that the two reflected rays will always be at the same distance away. 
$\color{green}{\checkmark}$ the distance between two normally incident ray remain the same irrespective of the refractive index of two medium.
In all the above two cases, it is to be noted that the two rays bend at the same value of the meter scale.
