Lonely is an adjective and means forsaken,desolate.
A person who is solitary need not to be lonely.
Solitary is an adjective.
1. It was a lonely place where no man ever came.
2. Aren't you lonely,living by yourself ?
3. A lonely island.
1. A solitary figure was seen coming across the fields.
2. A solitary traveller.
3. She was a solitary person.