Initially from Wikipedia
Of the three boundaries in the diagram, the light ray refracts the most at the air-diamond boundary. This is evident by the fact that the difference between the angle of incidence and the angle of refraction is greatest for the air-diamond boundary. But how can this be explained? The cause of refraction is a change in light speed; and wherever the light speed changes most, the refraction is greatest. We have already learned that the speed is related to the optical density of a material which is related to the index of refraction of a material. Of the four materials present in the above diagram, air is the least dense material (lowest index of refraction value) and diamond is the most dense material (largest index of refraction value). Thus, it would be reasonable that the most refraction occurs
Then what does heat do to the angle of refraction if the medium is heated?