The Size Beams are usually fitted in corridors to shoot lasers down towards the ground. If the playable characters are caught in the beam, it will alter their size. The red lasers cause the playable character to become ⅔ of his original size. This will allow the playable character to run through corridors otherwise too narrow to pass though. The white lasers will cause the playable character to return to their default size.
Sonic the Hedgehog CD
In Sonic the Hedgehog CD, Size Beams appear exclusively in Metallic Madness Zone 2. There, the player finds them near the end of the Zone, where he/she will have to go through a big maze full of Springs, monitors and other obstacles. Upon completing this "maze", Sonic will return to his normal size and will be able to proceed to the Goal Plate and finish the Zone.
In Sonic Mania, and its expansion Sonic Mania Plus, the Size Beam generators appear exclusively in Metallic Madness Zone. They also play a significant role for the boss fight in Metallic Madness Zone Act 2; before fight, the player has to pass through a Size Beam, forcing the playable character to face the boss as their miniaturized selves.
In other media
Sonic the Comic
In the Sonic the Comic british comic series published by Fleetway Editions, a midget version of Sonic from a near future encouraged Sonic into a Size Beam to make him small as well. This was done so that Sonic would be able to infiltrate a machine in the Miracle Planet's past to disable it and prevent it from turning the planet into a mechanical wasteland.