I can't answer this for Medieval warfare, but in Greek antiquity, the answer is both.
Evidence for the Archaic period (800-490 BC) suggests that archers roamed the battlefield like snipers, finding cover among the heavy infantry and picking off specific targets among the enemy army. This is the role of archers in the Iliad, where several heroes fight with bow and arrow; most famously, Paris brought down Achilles with an arrow. We see the archer-spearman pair on many vases, suggesting a common practice. Sometimes the archer himself is heavily armoured
By the Classical period (490-323 BC), archers had become more organised, being fielded in larger units and functioning as a group. These archers probably used indirect volley fire in battle, like the Persian infantry they fought during Xerxes' invasion, to increase their range and keep the enemy at bay:
They were continually using the enemy's arrows, and practised themselves in long-range work by shooting them into the air.
-- Xenophon, Anabasis 3.4.17
However, when they had the opportunity, these archers would have used direct fire as well. We can assume this from the fact that they served as part of the fighting complement of triremes in naval warfare. With only 4 archers per ship, indirect volley fire would not have accomplished much, so it seems likely that these men chose their targets on enemy vessels with care. In addition, we know that archers practiced shooting at targets, which would be useless if they only used indirect fire in battles:
[Agesilaos] also offered prizes to the peltasts and the archers who showed the greatest efficiency in their particular duties. Thereupon one might see every gymnasion crowded with the men exercising, the racecourse thronged with cavalrymen riding, and the javelin-men and archers shooting at the mark.
-- Xenophon, Agesilaos 1.25
Presumably, their technique depended on the situation. Archers were used in a great variety of roles, and these would require different approaches.
If I may expand to a related weapon, what about the crossbow?