Greek preparations
The Greeks who'd sent earth and water no doubt felt smug at news of Xerxes' approach. Many joined the invading force, making up perhaps as much as two thirds of Xerxes' army, although the cities who'd decided to resist did their best to get the others to join them "in the struggle for common freedom". The Athenians meanwhile had had this reply from the oracle at Delphi:
A wooden wall, alone, unconquered, does far-seeing Zeus grant to Athena, which will help you and your children. Do not you wait quietly for the great army of horsemen and footsoldiers coming from the continent…Herodotus, Histories 7.114 - 142
Themistocles
But what did it mean? One man knew. Two years earlier, there'd been a major piece of luck in the silver mines near Athens (where money was literally dug from the earth). A massive new vein of silver. But what to do with it? Now that Athens was a democracy, surely it should be shared out equally among all citizens? No, said Themistocles. Let's spend it on something to benefit us all, which will protect us from our enemies. He convinced them. They built 160 more wooden triremes - the very latest in military technology. These were obviously what the god meant by "wooden wall" - Athens must rely on her new fleet to protect her against the Persians.

The reconstructed trireme Olympias at sea
The Battle of Thermopylae
Meanwhile, Xerxes' force advanced unopposed through northern Greece. The Greeks (mostly from the south) who were ready to fight the Persians decided to make a stand.

Thermopylae: the sea was very much closer to the mountains in 480 BC
There's only one place where an army can move from northern to southern Greece - the pass of Thermopylae, scene of battles from 480 BC to WW2. There was a narrow gap (wider today) between the mountains and the sea: across it the Greeks built a wall (actually repaired an existing one), and waited. Herodotus says:
It was reported that there were so many barbarians, that when they fired their arrows, the sun was blocked out by them. Dienekes [the Spartan who Herodotus chose as 'man of the match'] was not alarmed, but said this was good news, since it meant that while the Medes were blocking the sun, they would fight them in the shade.Herodotus 7.226
There were contingents from all over Greece (Herodotus lists the cities, and the numbers of troops each provided: people remembered who fought and who didn't). Many were not yet at full strength - the Olympics were on. An advance guard of 1000 Spartans (including an elite 300 selected from those who had sons living) was there under their king Leonidas, the Greeks' chosen leader. Other cities' contributions brought the total up to about 4,000.
Xerxes sent a spy:
He saw the Spartans outside the wall, some exercising and others combing their hair, which astonished him.Herodotus, Histories 7,209
For six days, watched by Xerxes, the Persians attacked the wall, but were unable to break through the Greek defence. But eventually, a local Greek showed the Persians a way round over the mountains. This pass was guarded by a volunteer contingent from Phocis. By the time they heard the sound of leaves being trampled underfoot as the Persians climbed through the oak forest, it was too late. They fled for their lives. When news reached Leonidas, he soon realised that all was lost.

An oracle had foretold that a Spartan king must die to save Sparta. He sent the others home; Herodotus believes it was because he hoped to get all the glory for himself. Leonidas remained with his 300. All were all killed. There was carnage on the Persian side, too (Xerxes lost two brothers, and two other sons of Darius were killed):
Many barbarians died. For the officers were whipping them all, continually driving them forward. Many were pushed into the sea and drowned, many more were trampled to death by their own men. It was impossible to count the number of dead.Herodotus, Histories 7.223
The Spartans were buried on the site of the battle. An inscription was later set up on their tomb in their memory, bearing the simple words:
Go tell the Spartans, you who pass us by
That here, obedient to their laws, we lie supposedly by Simonides of Keos - quoted by Herodotus, Histories 7.228
At sea meanwhile …

The Persian navy (made up mainly of Phoenicians, Egyptians and Ionian Greeks) was based not far from Thermopylae, at an unidentified location called Aphetai. The Greek fleet (mostly from Athens although they'd agreed to a Spartan admiral to save argument) was stationed at Artemisium on the island of Euboea. The Persian plan was to send 200 ships right round the island and surprise the Greeks by attacking them from the south. But bad luck struck. First the Greeks were told of the plan by a deserter. Herodotus:
He is said to have dived into the sea at Aphetai and not come up again until he got to Artemisium, having swum more than 80 stades (9 miles.) under water. Personally, my opinion is that he came by boat.Herodotus, Histories 8.8
Then disaster. Although it was midsummer, a fierce storm battered the ships at Aphetai, and completely wrecked the ones sailing round Euboea. Herodotus comments:
All this was done by the god so that the Persian fleet would be equal with the Greek, and not considerably bigger.Herodotus, Histories 8.13
The actual Battle of Artemisium occurred on the same day as Thermopylae. It was a bit of an anticlimax - with mixed success and failure for both fleets. But as soon as they heard the news of the defeat at Thermopylae, the Greeks sailed off south, and anchored by the island of Salamis, just across from Athens.
There was nothing now to stop the Persians moving south. North of Athens, they had all medized - except the Phocians - who stayed loyal because they hated the medizing Thessalians. With the Thessalians guiding them, the Persians devastated Phocis - burning, looting, destroying temples, killing the men and raping the women. But, according to Herodotus, Delphi itself was saved by the god.
The road to Athens was now wide open. What of the wooden wall?