Laser cannons are attached to the underside of platforms and move back and forth along them raining down laser beams. If you want to avoid these hazards walk in the opposite direction that they're moving to run between laser blasts, otherwise you're sure to get hit.
Laser cannons are actually quite difficult to avoid. In area 10 most of them are beyond your ability to reach so you have run between their laser fire. However, if you take your time and move in the opposite direction that they do you can get by without a scratch.
The Game Boy version of the laser cannon is a little easier to deal with. It has less hit points and can always be reached to be destroyed. It acts the same, moving back and forth and shooting lasers, but it's much easier to deal with.