(Not universally applicable, unfortunately.)
Literally: answer – disease – give – medicine
Alternately: Just what it says on the tin: giving someone medicine appropriate to the illness they are suffering from at the time. By extension, teaching people the lessons they need (especially moral lessons, or in a Buddhist context, Buddhist teachings) in a way appropriate to their personal character, aptitude, and situation in life.
Notes: This compound may also be given the Japanese-style reading 病に応じて薬を与える (yamai ni oujite kusuri wo ataeru). It has a number of synonyms, including 対症下薬 (taishou kayaku, “giving medicine against the symptoms”) and 因機説法 (inki seppou, “teaching (Buddhist) law based on the opportunity”).
Most of my sources are silent on the origins of this phrase, but one attributes it to our friend, the Saṃyukta Āgama (Japanese 『雑阿含経』= Zou agon kyou).