I think your talking about refraction and if so the first medium it existed in before entering the second usually has the higher speed especially it the first medium is less denser than the second
The atoms become aligned in a particular direction in regions called domains, thus resulting in an overall resultant magnetism due to the spin of the electrons.