To counter spam attacks, try to block the attack (the character blocks attacks if you do nothing, or just walk), hit back with a quick attack (kicks are fast and some characters have a normal attack fast enough).
If you still can't beat a specific character, try choosing a character that is more effective in this case. For example, Azuma would be a good choice against Shang and Ironclad against Yukka.