I understand that they can't carry shields because they need both hands for the Pike, so what stopped them from being shot by arrows?
Please bear in mind that my knowledge of medieval warfare is based on games of thrones.
Armor, generally. Depending on the period and the area, pikemen were more heavily armored than general infantry of the earlier middle ages. Munitions grade plate armor started to become available as the pike "blocks" like the tercio/landsknechts/swiss evolved. As plate armor became relatively cheaply mass produced compared to earlier ages, bows began to lose effectiveness. Bows were inadequate to pierce steel plate armor at any significant range, and crossbows didn't have the huge range advantage that longbows had, although they were still an important part of a late medieval army. It would take gunpowder to eventually "break" the armored pike blocks for good.
Macedonian pikemen did have small shields (pelta) strapped over their necks and hanging over their left shoulders, leaving both hands free to use a pike, and pikemen wore varying amounts of armor.
However, the short answer is that unsupported pikers were quite vulnerable to missiles.
At the Battles of Falkirk and Halidon Hill, for example, the Scottish pike forces were essentially helpless against English archers. More mobile pike formations could attempt to charge and overcome their enemies in shock action. The Swiss were able to use surprise to defeat the Burgundians at Grandson with only pikes, for example, even though their enemies had significant forces of archers, crossbows, and gunpowder artillery, but overall pikers were not at their best against missile-oriented foes.
The most effective use of pikes has generally been in conjunction with other arms. (Then again, the same could be said of any individual arm.) The Macedonians under Philip and Alexander complemented their pike forces with heavy cavalry, archers, javelineers (mounted and on foot), etc. The Spanish Tercio likewise combined pikes with arquebusiers.
Archer Jones, in The Art of War in the Western World, described ancient-to-medieval weapon systems strength and vulnerabilities in this schematic. ("Heavy" is used as a term for any close-combat forces, including pikes, while "light" is used for any missile forces, including archers.) It's a slightly simplistic rock-paper-scissors scheme, and you can find some cases of, e.g., heavy cavalry managing to trap and defeat light cavalry (Lechfield, for instance), but the basic idea -- in this case, that pikes are good for some things (e.g., defending against lance-wielding heavy cavalry), and not so good for other things (e.g., fighting against missile troops) has some validity.