From the Super Mario Wiki
Paper Mario: The Thousand-Year Door
In Paper Mario: The Thousand-Year Door, it is a yellow block with a Shine Sprite inside it. It appears various times throughout the game. Mario must hit the block to get the Shine Sprite that is inside it. The Shine Sprites are useful for powering up Mario's partners, similar to the Super Block from the previous game.
"That's a Shine block. When you hit it, a Shine Sprite pops out." --Goombella
Mario & Luigi: Partners in Time
In Mario & Luigi: Partners in Time, they are semi-rare red blocks with a Shine Sprite and an "M" on it, but it can change (see below). It is always found near the entrance of a dark room. In each dark room, the babies must go by themselves. The rooms are totally dark except for some of the bigger platforms. There is always a thin walkway weaving through the room, which serves as protection over the spikes on the room's floor.
However, the thin walkways are invisible unless the Shine Block is struck. If the Shine Block is red, Mario should hit it. If it is green and has an L in place of the M, Luigi should. Once the block is hit by the correct brother, a smaller blue block with a Shine Sprite on it will come out and float over to the babies. When struck, this block bathes the dark room in light for a short time, after which the light fades, and the adult Mario Bros. must hit the Shine Block again. There is a trick which can be used to negate the need to constantly resupply light: if the player pauses as the light is fading, when they return to the game, the room will remain dimly lit, which should be enough for the player to see the walkways.
If the wrong brother hits the Shine Block, a Fireball will come out, landing on the babies and forcing them to start the room over. The babies will also start the room over if they fall on the spikes. However, no damage is done for either circumstance. It is possible, though, to avoid the Fireball.