Why is there a vertical black line on my right big toenail?

Trauma. A dark line that runs vertically down the nail can indicate that you might have traumatized the nail matrix(the area where the nail starts growing). Other possibilities are fungus, melanoma and genetics. See your doc for a full evaluation.
Black stripe nail. This could be a mole or freckle in growth center of the nail (matrix), fungal infection of the nail & a melanoma under the nail. Needs a diagnosis. Melanoma is a dangerous skin cancer that needs to be diagnosed & treated as soon as possible to have better chances of a cure. If this is a new pigmented streak, if it is changing (darker, wider, more irregular), please see a dermatologist asap.
Usually genetic . Melanonychia striata is a possibility would need a picture also may have just damanged the nail root and could be scar changes that originate at the root level . I would get it check by a podiatrist.