usually it is caused because of lack of proper self oral hygiene(tooth brushing).Which might faciliates growth of bacteria and yeast.Other factors associated with black hairy tongue might be excessive tobacco coffe or tea drinking..
Brushing teeth daily or the use or tongue scraper might solve the problem.Also using diluted hydrogen peroxide (one part peroxide to five parts water) might prevent bacteria and yeast from colonization..
Decreasing the use of smoking,actually cesessation might help.If its severe using anti fungal oral medication like Clotrimazole,Ketoconazole,Fluconazole might help.visit your doctor for prescription.