In Ancient Greece, the spear was the main weapon used in warfare, it was easy to produce and "quick" to learn how to use, perfect for armies made of militia and non-carreer soldiers. I don't know much about Roman warfare, especially regarding weaponry and equipment, although it seems more flexible and diverse regarding the types of weaponry, but still had a heavy leaning towards the use of the spear. However by Medieval times the sword seems to have taken a more important role than the spear. What caused the changes of weapon of choice between the Greeks, Romans and Medieval Europeans? What were the reasons for one type of armament being better suited or more useful for a certain time period and situation?
P.S: I'm sorry if the way I wrote this is a confusing, if you want me to clarify something about my question feel free to ask!
However by Medieval times the sword seems to have taken a more important role than the spear.
Not on the battlefield - the battlefield was still dominated by spears and other polearms and by missiles (bows, crossbows, and in the later Medieval period, guns). For some past discussion and examples of Medieval art showing battlefields with spears aplenty, see
That said, swords were very common on the battlefield, more common than spears. Most spearmen carried swords as sidearms, as did archers, crossbowmen, arquebusiers, and cavalry. If archers had the good fortune to engage in close combat, they would use their swords. Cavalry would typically use a lance as their weapon of first choice, but lances broke or were lost in targets, and they would use swords (or maces, or warhammers, or axes). But this isn't that different from ancient warfare, when phalangites and cavalry would usually carry a sword, but use spear/pike and lance/javelin as their main weapons.
One could say that the sword was more important in ancient warfare, with short sword and shield seeing common use in both Roman and Chinese armies as a primary weapon. An example of Roman art shows swords (and spears) in use:
(many of the weapons, both swords and spears, are broken off, but sword hilts can be seen in many hands). And a Chinese example:
There was an increase in the number of swords being carried on the battlefield from the early Medieval period to the later, at least in many parts of Europe, where early Medieval soldiers/militia might carry an axe or seax/large knife as their sidearm. This appears to be due to the increasing availability and lower price of swords, and increasing professionalisation of armies.