In case if rainbow ,its because of refraction,internal reflection and dispersion.after the rainfall the water vapours suspended in the atmosphere acts as prism and thus makes rainbow.the prism doesn't makes any color of it itself but is because of natural the white colour is made of seven colours and when white colour travels through prism dispersion occurs
Light splits because of difference in speeds of different colors i.e.,red has the highest speed whereas violet the least therefore red scatters the least
1 5 1