No. Those elements don't refract light. Crystals of clear compounds like water, ice and carbon in diamond form do. As does oil on water and water drops which give us the optical illusion of rainbows.
The sunrise and sunset are red for a similar but slightly different reason..
The Sun's rays have to travel a shorter path through Earth's atmosphere in the day. This is why the sky looks blue during the day.
When sunlight strikes gas molecules, such as nitrogen and oxygen, light of longer wavelengths, like red, yellow, and orange, easily passes through, while light of shorter wavelengths, such as blue and violet, is absorbed and then scattered in all directions by the gas molecules.
When you look up at the sky during the day, this scattered blue and violet light reaches your eyes, however, the human eye is more receptive to blue frequencies than violet frequencies, so the sky looks blue.
This phenomenon is known as Rayleigh scattering. It is named after British physicist John William Strutt, also known as Lord Rayleigh. Besides making the sky look blue, it is also the reason why the Sun looks yellow during the day even though sunlight is white. When the Sun is high in the sky, the light has to travel a shorter distance through the atmosphere. This means most of the yellow, orange, and red light passes through while a small amount of blue and purple light is scattered and removed from the mix. The Sun, therefore, looks yellow for us here on Earth.