Tricks of light
Shedding bioluminescent light on the situation can work as defence.
Bioluminescence is useful as an escape strategy as well as for attack. A shrimp senses a threat and spins in the water, releasing a bioluminescent glue that startles the fish and leaving it illumiated in the dark and vulnerable to its own predators. Other prey animals such as copepods have developed tactics to use bright or flashing lights to communicate with one another and confuse their predators, allowing them precious moments to get away unharmed. The most sensitive eyes in the deep sea belong to an ostracod called gigantocypris. It's the size of a pea, but that's enormous for an ostracod. Copepods are a favourite prey and it actively searches for their flashes in the darkness. But some copepods discharge packets of bioluminescent liquid whose flashes are delayed and go off like depth charges, confusing the ostracod as to their whereabouts. Spinning confused in the water, the ostracod chases after the flashes and the copepods slip away unseen into the darkness. The ultimate biolumiscent defence mechanism has to be the show created by the deep sea jellyfish periphylla. Presumably, its entire body flashing with light scares away its enemies.