A black fingernail is known as a subungual hematoma. It is caused by a build-up of blood under the fingernail.This usually results from an impact or trauma to the finger which can cause considerable pain. In most cases, ice and ibuprofen are sufficient to treat it.