It depends on the type of spell. Some need more thought and concentration. However, in all spells, the word/s which activate the spell need to be spoken aloud or thought very clearly. More complicated spells need something more, such as the patronus charm, which requires the ability to relive a very happy memory vividly and clearly.