Being in sun form is not enough, you need to use the sun form's charged "attack." It works just like the charged attack from energy form, except you don't do any damage. it just leaves a big sphere of light that lasts for a number of seconds. (try it in the abbys) In the Octomom room, this will instead dispel the octopus created darkness.
For what it is worth, the quick and dirty way to beat her, is to just grab the floor right in front of Octomom, barely out of reach of his grab, but within reach of his slap. Just eat the damage she does to you, and keep firing at her weak spot. Once she is dead, you have all the time in the world to dispel the darkness.