From the Super Mario Wiki
Caged Ghosts are close relatives to Dangling Ghosts that grow from drainage grates in the floor. They are gelatinous ghosts found mainly in World 3 in Super Mario World 2: Yoshi's Island and Yoshi's Island: Super Mario Advance 3. They spit green Shy Guys at Yoshi as their primary attack, who may turn them into the ghost's only weakness: Eggs.
There are two different kinds, the ones that are squeezed into sewer tunnels, and the large round mounds. By being hit with eggs, the ghost will shrink/recede, until it's at its farthest point, then after a few seconds it will grow out again.
 Names in other Languages