The invention makes use of optogenetics, a technique in which the DNA that codes for a light-sensitive protein is inserted into certain cells, enabling those cells to be activated by pulses of light. Researchers often use this method to study neurons in the brain, but in this case the researchers altered flies' heart cells. Then they activated those cardiac cells using pulses of light, causing them to contract in time with the pulses (abstract). Voila, they had an optical pacemaker that worked on living adult fruit flies.
Don't worry, no one can control your heartbeat with a laser just yet. That would require inserting foreign DNA into your heart cells, and also finding a way to shine light through the impediment of your flesh and bones. But lead researcher Chao Zhou of Lehigh University is working on it.