You could have a look at electromagnetic induction. When the electromagnetic field through a surface surrounded by a conductor changes, this will generate an electric current which in turn generates a magnetic field that resists this change. In the case of a superconductor, the generated field will be precisely strong enough to stop the change completely.
Since light is electromagnetic radiation, we can imagine a substance which similarly manages to partially or fully cancels out all light that passes through it by generating electromagnetic fields opposite to the waves of the light.
severe speculation:
It seems like what you'd need to achieve this is a bunch of charged particles that are able to move without resistance. A massless charged particle seems ideal here. Sadly, since it is massless, it would be unable to not move at the speed of light. If they move around in a confined space randomly, they would create an incredibly strong and chaotic electromagnetic field. Though you could just invoke quantum mechanics and claim they move in all directions at the same time (much like particles with mass at rest bounce off the higgs field in all directions at the same time) and therefor create no net electromagnetic field. 531
Another problem becomes simply containing these particles, and this is a big one. You'll have to use electromagnetism to keep these particles together and this will likely be just as difficult as what the particles are doing for you (canceling the light). But could possibly be more straightforward. (Maybe a rather simple, if powerful electromagnetic field would be enough to turn any particle headed out of the confined space around.)
what would this achieve?
Well, since these particles can only cancel out light within their volume, light would be able to pass through it largely unchanged. However, inside the substance all light would be entirely canceled out. which means that it would be pitch black.
So the way to use it is to surround your enemies with it (or just their heads) and though you will still be perfectly able to see them, all they would see is darkness.
some possible side effects
This would interact with all electromagnetic fields, including that of the earth, so if you move this substance it would generate a field to resist this change. Since this resists all change in electromagnetic fields, it is possible that brains and nerves in general stop working within this substance. I'm not sure how to solve this one without some serious handwaving. 477