Is there a logical story behind this phrase? Because when looked at from a naive perspective, giving somebody their own medicine sounds like a kind thing to do as it would only treat their illness. The phrase only makes sense in the context of someone who knowingly sells poison as medicine, which is a rather rare thing (or was it common in the old times?).
The most popular origin story I could find about "dose/taste of one's own medicine" is a tale where a cheat sells a medicine that does nothing, then gets sick and people give him his own medicine. And even with this background, it makes little sense, as the medicine doesn't sound like it harms him. Does anybody know the name of this story? Perhaps there's more depth to it.
Best Answer
John Ayto, Oxford Dictionary of English Idioms, third edition (2009) has this entry regarding the sense of the expression:
During the nineteenth century, medicines often tasted quite horrible, and many were of dubious efficacy (if not downright harmful) to the patient. Under those circumstances, the idea of "receiving what you prescribe for others" may be understood as similar in sense to such folk expressions as "what's sauce for the goose is sauce for the gander" and "turnabout is fair play."
The first Google Books search match for "a dose of [one's] own medicine" is from 1835; the earliest match for "a taste of [one's] own medicine" is from 1866 (although the Library of Congress newspaper database finds an example from 1859). The examples that follow are drawn from both Google Nooks matches and Library of Congress newspaper database matches.
'A dose of [one's] own medicine]'
Here are some early instances of this form of the expression. From William Leggett, "Brought to the Gangway," in The New York Mirror: A Weekly Gazette of Literature and the Fine Arts (April 19, 1834), in a scene in which a naval lieutenant is ordering the flogging of a sailor:
From the New York Daily Tribune (November 5, 1842):
From "Chance for Another War!" in the [Brattleboro,] Vermont Phœnix (August 19, 1847):
From "Mr. John C. Rives," in the [Washington, D.C.] Daily Union (April 2, 1851):
From Charles Coffin, Four Years of Fighting: A Volume of Personal Observation with the Army and Navy (1866), describing the Union army's advance toward Memphis after the Battle of Shiloh in April 1862:
From remarks of Senator Chambers in The Congressional Globe (April or May 1869) urging adoption of a Proclamation of Neutrality with regard to Great Britain and Abyssinia mimicking the British Proclamation of Neutrality of 1862 [combined snippets]:
'A taste of [one's] own medicine'
The first example of this expression is from the Richmond [Virginia] Dispatch, reprinted in the Yazoo [Mississippi] Democrat (December 24, 1859):
From "Stinging Speech of Mr. Van Wyck of New York -- The Chivalry Enraged by His Home-Thrusts" in the Cleveland [Ohio] Morning Leader (March 17, 1860):
From the [Wheeling, Virginia] Daily Intelligencer (August 29, 1860):
From the Montgomery [Alabama] Ledger, quoted in Whitelaw Reid, After the War: A Southern Tour: May 1, 1865, to May 1, 1866 (1866):
From "The Trial of Ghosts," in The Youth's Companion (October 3, 1872):
And from a letter on the subject of alcohol prohibition, dated July 19, 1874, in The Index (August 6, 1874):
Conclusions
The saying seems to have originated as "a dose of [one's] own medicine" (in use by 1834) and later expanded to include the variant wording "a taste of [one's] own medicine" (in use by 1859). I didn't find any evidence from nineteenth-century sources that a particular incident or story might have served as the source of the expression. It seems more likely to me that in the 1800s most people regarded the bitterness (and dubiousness) of medicinal remedies as a commonplace, and found it natural to equate a doctor's being forced to take his own medicine with a person's having had done unto him or her some unpleasant thing that he or she had previously done unto others.