The reason I asked is your basil might be suffering from "damping-off," considering the problem is right at the soil line. In addition to turning black, is the stem also withering at soil line?
Damping-off is a soil-borne fungus, to which overwatering contributes. Make sure your soil is sterile, make sure your container has drainage, and don't overwater.
Let us know how it turns out.