They will run away if they are hit by i flash of light that is the same colour as them.
The flash can only reach ghosts in the front now, but the ghosts behind come forward to fill in any gaps.
Each colour flash has a limited number of uses.
Eliminate all of the ghosts using the number of flashes you have at your disposal.
There is a limit to the number of times you can use each flash.
Figure out the best order to use the colours in, making sure that the row of ghosts at the back doesn't end up hanging around.
Use the red flash first.
Then use the red flash again and the blue flash so that the green ghosts are brought to the front.
Continuing on from hint two...
You have one blue flash left.
You need to eliminate all of the remaining blue ghosts with this one flash.
Use the green flash first to bring the blue ghosts to the front.
The last flash to use is the green one.
Eliminate the ghosts right at the front first.
The answer is as follows.
red, blue, red, green, blue, red, green.