The Rabbis enacted a prohibition against taking medications on Shabbat due to the concern of "Shechikat Samemanim" – that one may grind herbs. In Talmudic times, people would often prepare their own medications by personally grinding herbs, which is forbidden on Shabbat. The Sages therefore legislated that unless one feels ill to the point where he is bedridden, he may not take medications on Shabbat.
Does this prohibition apply on Yom Tov, as well, or does Halacha distinguish in this regard between Shabbat and Yom Tov?
The Gemara in Masechet Beitza (22) tells that the sage Ameimor applied ointment to his ailing eye on Yom Tov Sheni (the second day of Yom Tov observed in the Diaspora). The Ritva (Rabbi Yom Tov Ashbili, Spain, 1250-1330) explains that Halacha permits taking medications on Yom Tov because on Yom Tov one is permitted to perform Melachot (activities forbidden on Shabbat) for the purpose of preparing food. Hence, grinding herbs for food preparation is allowed on Yom Tov, and the principle of "Mi'toch" extends this rule to allow grinding herbs even for other purposes, provided that this is needed on Yom Tov itself. There was therefore no reason for the Rabbis to forbid taking medications on Yom Tov.
The question, however, remains, why did Ameimor allow applying medication to the eye only on Yom Tov Sheni, the second day of Yom Tov? If, indeed, there is no prohibition whatsoever against taking medications on Yom Tov, then applying medicinal ointment should be permitted even on the first day of Yom Tov.
The Ritva answers that Ameimor was uncertain whether the ointment would be effective in alleviating his discomfort. Therefore, since the benefit of this procedure was doubtful, he allowed it only on the second day of Yom Tov, which Halacha generally treats somewhat more leniently than the first day.
Chacham Ovadia Yosef, in Chazon Ovadia (Laws of Yom Tov, p. 23), notes that all medications nowadays have been tested and approved by experts in the field, and therefore, applying the Ritva's rationale, Halacha would allow taking medications even on the first day of Yom Tov. Hence, a person who experiences pain or discomfort on any day of Yom Tov may take any medication that he can assume will help alleviate his condition (such as aspirin or Tylenol). Likewise, one may ingest foods or liquids for medicinal purposes, even foods or liquids that are generally ingested only as medicine. Yom Tov differs in this respect from Shabbat, on which one may not take medication unless he is bedridden.
Summary: It is permissible to take medications on any day of Yom Tov.