The story of Medicine-King Bodhisattva begins with an explanation of his accomplishments in a previous life. In Chapter Ten, the “Teacher of the Law,” Medicine-King represented eighty thousand Bodhisattvas who heard Sakyamuni teach. In this chapter, Sakyamuni tells a Bodhisattva by the name of Star-King-Flower about the Medicine-King.
A long time ago, there was a Buddha called Sun-Moon-Pure-Bright-Virtue Tathagata. Among his many disciples, there was one named Gladly-Seen-By-All-Beings Bodhisattva. He studied the Lotus Sutra under this Buddha, and underwent difficult practices for many years until he attained the samadhi by which he could transform himself into any other living being (p. 299-300).
The samadhi by which he could transform himself into any other living being is the samadhi (the power of concentration) that is the ability to show an appropriate physical form according to the person’s capacity to whom he preaches the dharma.
Introduction to the Lotus Sutra