The ozone layer acts as a shield against dangerous ultraviolet rays from the sun.