From the Super Mario Wiki
Pyro Boxes appear in all of Bowser's levels and Lethal Lava Land. One also appears in Rainbow Ride. These boxes are diamond-shaped with a hole in the center. About every three seconds, a Pyro Box shoots a stream of fire from its center. Pyro Boxes cannot be destroyed.
If hit by the flames, Mario will lose three life points. Additionally, Mario will run around uncontrollably, possibly forcing the plumber over the edge of a cliff. If Mario jumps around while he's on fire, he may only take two points of damage.