Make a visible laser beam affected by material refraction.

I would like to be able to shoot a visible beam of light that will be affected by the refraction index of the materials it passes through. Something like the line trace function but an actual visible ray, so its path can be seen from different angles. Is something like this even possible? Thanks.