kein = nicht ein.
So whenever there's a negated indefinite article, you use "kein". Otherwise you use "nicht". Remember that "nicht", like some other adverbs, is always put directly in front of the part of the sentence that's negated.
If it's emphasized strongly, "kein" can be broken up again:
Sie sprach kein Wort -> Sie sprach nicht ein Wort.