whereas lights aren't actually a necessity in a fish tank, they are more for our benefit, it's obviously nice to be able to see your fish. If this problem persists, try putting something in the tank that will enable the Oscar to hide when the lights are on, maybe a large piece of wood, or a large plant pot.
It may be just a case of you leaving the lights on and letting him get used to it. If you automatically turn the lights off every time he lays on his side, he'll never get used to them. Oscars are very strange fish, I've never come across fish that act quite the same as them.