Ouch! hey I heard that normally happens when you shoes are too small when you run.
Too big, too small, laced too loose and you're running downhill, you're doing something weird with your toes... there are lots of reasons for black toenails. It's worth checking your shoes but IME it's not automatic that the shoes need to be bigger.
The discoloration is blood trapped under your nail. If the blood is still fresh/not dried up, it may feel better to drain the blood (sterilize a needle and puncture the dark spot).