X Equestris
Maester
This is going into the realm of Alternate History and some major speculation, but here we go.
Horse archers from the late Roman periods (Huns, Alans, etc) would absolutely devastate a phalanx. The large, densely packed blocks are a perfect target for the archers, who would simply run around the formation and pepper it with arrows. This was always a problem for phalanxes, as seen at the battle of Sphacteria. Spartan hoplites were harassed constantly until they were forced to surrender, unable to come to grips with light Athenian skirmishers. Also, the Thebans made very extensive use of missile troops when they defeated Sparta later on.
Alexander managed to beat an army of Scythian horse archers, though I doubt anyone other than a very skilled general could replicate that feat.
The problem of skirmishers could be countered by cavalry. Indeed, the failure of their cavalry to show led to Spartan defeat at least once against Athenian peltasts.