During sunrise and sunset, the rays have to travel a larger part of the atmosphere because they are very close to the horizon. Therefore, light other then red is mostly scattered away. Most of the red light, which is the least scattered, enters our eyes. Hence, the sun and the sky appear red.