The spirit and power of Elias is to act as a forerunner, to prepare the way of the Lord. Obviously, John the Baptist is the best example of an Elias in this sense, but Joseph Smith made it clear that there were many others who acted with the spirit of Elias. Therefore, we see that Samuel the Lamanite also prophesied according to the spirit of Elias for he gave the same message, a call to repentance and an invitation to prepare the way of the Lord.
Joseph Smith
“… the spirit of Elias was a going before to prepare the way for the greater, which was the case with John the Baptist. He came crying through the wilderness, ’Prepare ye the way of the Lord, make his paths straight.’ And they were informed, if they could receive it, it was the spirit of Elias…The spirit of Elias is to prepare the way for a greater revelation of God, which is the Priesthood that Aaron was ordained unto. And when God sends a man into the world to prepare for a greater work, holding the keys of the power of Elias, it was called the doctrine of Elias, even from the early ages of the world.” (Teachings of the Prophet Joseph Smith, p. 335-6)