Does one say a beracha on medication? Does it matter whether it tastes nice or not? Is there a difference between pills and liquid medicine?
R’ Moshe Feinstein (Igros Moshe OC 1:82) writes that if the medication itself tastes nice, then one should recite a beracha. R’ Ephraim Greenblatt (Rivevos Ephraim 4:54:39) writes that R’ Yosef Shalom Elyashiv held that if one mixed the medicine into something that tastes good, one would need to recite a beracha on it.
R’ Dr. Avraham Avraham (Nishmas Avraham 204:1) writes that R’ Yehoshua Neuwirth (Shemiras Shabbos Kehilchasa 40:n191) held that one doesn’t recite a beracha upon taking medicine that has flavouring added to make it taste sweet since the main ingredient is bitter though R’ Ovadia Yosef (Yalkut Yosef 204:10:n10) held that one should recite a beracha. Similarly, R’ Shlomo Zalman Auerbach (quoted by R’ Dr. Avraham) held that one should recite a beracha on pills that are coated with sweeteners.
The Shulchan Aruch (OC 230:4) writes that one about to undergo a medical procedure should recite: יְהִי רָצוֹן מִלְּפָנֶיךָ ה' אֱלֹקַי שֶׁיִּהְיֶה לִי עֵסֶק זֶה לִרְפוּאָה כִּי רוֹפֵא חִנָּם אַתָּה, "May it be your will, Hashem, that this procedure should cure me, for You are a Doctor who does not charge," and afterwards, בָּרוּךְ רוֹפֵא חוֹלִים, "Blessed is the One who heals the ill" (See Mishna Berura 230:6).
R’ Dr. Avraham quotes R’ Eliezer Waldenberg who says that one should say these prayers before and after taking medication. This would serve in place of reciting a beracha, thus satisfying both views.
Source: Dose of Halacha
The existing answer provides a nice survey of final p'sak. The following is the development from the sources:
The Gemara Berachos 36a has the following conclusion:
מהו דתימא כיון דלרפואה קא מכוין לא לבריך עליה כלל קמ"ל כיון דאית ליה הנאה מיניה בעי ברוכי
What might one have thought? Since [the purpose of its comsumption] is intended for medicinal purposes, one would not make a blessing. This teaches us that since he gets pleasure from it, he is required to bless.
The context of the Gemara's discussion is a mixture of oil and some form of beet mixture, in which the oil is present to soothe the throat, and soothing the throat was the primary intention for drinking it. However, due to the beet mixture, it was an enjoyable drink.
דאית ליה הנאה מיניה. לבד הרפואה יש לו הנאת אכילה
He gets pleasure from it: Aside from the [pleasure of] healing, he has the pleasure of eating.
Tosefos says the same in s.v. כיון, and explicitly applies the principle to liquids.
The Shulchan Aruch cites this principle in O.C. 202:4, that if one drank oil in a mixture, to soothe his throat, he would make a blessing on the oil. The Magen Avrohom (204:8) generalizes the principal to all liquids and even to solids.
When the medicine is in a mixture such that it tastes good, even though a blessing is made, the blessing is not necessarily on the medicine. The Magen Avrohom (O.C. 202:10) holds that even if there is only a small amount of the medicinal substance, if the intent of consumption is for medicinal purposes then the blessing is made on the medicinal substance (and so the Mishna Berura (202:31) concludes), however he suggest according to the Rosh that there must at least be a substantial amount of it (or possibly even a majority - see Machazis Hashekel), even if it is the minority. The Elya Rabba concludes that there must be at least a significant amount.
I heard from Rabbi Y. Frand that the implication of the suggestion of the Gemara that one would not recite any blessing when the intent of consumption is for medicinal purposes (as opposed to reciting a blessing on the non-medicinal portion) implies that that which is enjoyed, but is only present to facilitate the medicine, does not merit a blessing - either because it is secondary to the medicine, or because a taste which is only there to cover up another taste and not for the sake of its own taste is not considered a significant taste. This would line up with the opinion of R' Neuwirth cited in the other answer.