The technical aspect of this is deep in debate. But the short answer is, light acts as both a particle and a wave. It's one of those mysteries of science that still is not completely figured out. If anyone claims that it is one or the other, call them a liar. It was decided 80 years that it was a wave, but even that was overturned just a few short years ago.
If you want to look into it further, the name that they gave the action is 'Duality'.