Shogun - Rich and powerful lord - He answers only to the Emperor
Daimyo - Feudal Lord - The Samurai would swear their allegiance to him
Samurai - Particular class of warrior family which defended the Daimyos. These warriors were highly trained in the military arts. Over time Samurai became synonymous with Bushi (warriors).
Ronin - Bushi or Samurai who were under no obligation or loyalty to a particular lord, or a Samurai whose lord was deceased, or worse, whose lord had been banished and his property confiscated. Actually Ronin functioned as "hired swords" and their very existence went against the philosophy and principles of the Bushido Code.
Ninja - Warriors of a lower rank. Not from families of established warrior status. The Ninja served various lords -- usually as guerilla fighters, assassins or spies.