This is a topic regarding the Phalanx vs missle fire...both the Greek and Macedoian systems.
The Greek system has a massive thick shield, the Aspis and Hoplites covered in armour. It seemed to held out well against Persian archers(from the front in formation.) However that is not to say they needed to rush at the enemy(ie. Marathon getting abliterated by missles. The Athenian javelin thowers annihilated a Spartan Morae before with javelins and arrows.
The Macedonian phalanx uses a smaller shield but is known to have a mass dense of pikes that could catch and defelect arrows. However this may only apply to indirect fire as the spears were usually held in a 45 degree angle.
Alexander's used the phalanx in offense rather than defense. A reason for this may be is to close with the enemy so they can't use their missles(like the Persians)
However the Phalanx did get shaken by missle fire before. At the Battle Granicus, the Longbowmen of Porus along elephants, shook the phalanx and it was the cavalry charge by Alexander that saved them.
If you look at later Hellenitic battles, skirmishers, archers, and slingers are staple of Hellenistic battles, reminding me of battles of Pike and Shot period.
Persian horse archers and the Battle of Ipsus flanked the phalanx of the Antigonids and shot arrows at them, causing them to break morale.
And this is a topic on the Roman Pilum vs the Phalanx:
siege of Atrax
"But in the narrow space - for the breach in the wall was by no means a wide one - the kind of weapon he used and his style of fighting gave the enemy an advantage. When the serried Macedonian ranks presented their enormously long spears it was like a shield-wall, and when the Romans after fruitlessly hurling their javelins, drew their swords they could not get to close quarters, nor could they hack off the spear-heads; if they did succeed in cutting or breaking any off, the splintered shafts kept their places amongst the points of the uninjured ones and the palisade remained unbroken. "
Livy.
This is to say the Roman Pilum was ineffective in the battle. Maybye due to the fact the Pilum is a rather low velocity could get trapped in the forest.
However at the Battle of Magnesia the Pilum did some damage causing them to retreat:
The Phalanx in order to avoid the flanking of Romans, formed square.
"The Romans did not come to close quarters nor approach them because they feared the discipline, the solidity, and the desperation of this veteran corps; but circled around them and assailed them with javelins and arrows, none of which missed their mark in the dense mass, who could neither turn the missiles aside nor dodge them.
After suffering severely in this way they yielded to necessity and fell back step by step, but with a bold front, in perfect order and still formidable to the Romans"
Appian.
Although the phalanx didn't break to the Roman Pilum and arrow fire at Magnesia(until the were caught between their own elephants) they did retreat due to the effect of it and "suffered severly" and took many causualties.
So missle fire doesn't destroy the Phalanx, it did distrupt it IMO.(like missle weapons are meant to do to formations)
It was the phalanx offensive charge supported by cavalry that made it sucesful. If it is defensive it usually gets destroyed