What polarizes the light from a rainbow. I already did some search and couldn't get a clear answer. All I could find was the light is polarized on the direction light is entering. What happens to the remaining light? Or more specifically, if an light polarized perpendicular to this direction, enters a medium of different density does it gets refracted, or it passes through as it is or gets blocked completely?
In the case of rain droplets, where the size of the drop is much larger than the wavelength of visible light, the effects you see can be described in terms of the familiar concepts of refraction, reflection and diffraction (AKA geometric optics). The rainbow is generated by different colors being refracted at slightly different angles as they enter the drop, reflecting off the back of the drop and then being refracted again as they exit the drop (see this diagram). The reflection part of this is what leads to the polarization of the rainbow. When light transitions between two optically different mediums some of the light is transmitted and some is reflected, with the polarization component parallel to the surface being more strongly reflected(see this diagram). This leads to a preference for one polarization orientation for the light leaving the back of the drop and a preference for an orthogonal orientation for the light passing through the drop.
If you are wondering why there is a preferred polarization I would suggest you look into Fresnell's Eqautions but conceptually the idea is basically just that the polarization component parallel to the surface interacts the least with the medium.
The first diagram red vaaaal listed, unfortunately, is one of the leading causes of misunderstanding how rainbows are formed. It isn't wrong, but it suggests that red light is deflected exclusively at 42°, and that each color has its own exclusive angle.
But it is easy to see, if you look, that light that is originally headed straight for the center of the drop will not have the colors separate, and will deflect at 0°. And that the light between the centered ray, and the one shown, can have red light deflected at any angle between 0° and 42°.
What actually causes the rainbow, is that there are more incident rays that produce deflected red rays near 42° than any other deflected angle. The fact that violet is above red in the diagram is not relevant; the fact that violet has its similar maximum concentration at 40° is what is relevant.
What polarizes the light in the colored arc of the rainbow, is that the internal reflection angles where this concentration occurs also happens, by coincidence, to be close to Brewster's Angle. That's where only perpendicularly polarized light reflects.