Spectres spawn in the darkness at quite a low depth and are almost invisible. When they get in close contact with a player they apply a random curse to a weapon, tool or armor item and then disappear. They can be defeated simply by lighting up the area.
On death, spectres will convert sand below them to soulsand.
You can configure spectres to not curse player items; instead, weakness debuff will be applied.