Rikaine Delmarre, a prominent robotocist of Solaria (a planet politically hostile to Earth), is murdered. Elijah Baley is called in to investigate, at the request of the Solarian government. He is again partnered with R. Daneel Olivaw. Before departing Earth, he is asked by Earth's government to assess the Solarian society for weaknesses.
The book focuses on the insanity of Solarian society. The planet has a rigidly controlled population, and robots outnumber humans twenty-thousand to one. People are strictly taught from birth to despise personal contact. They live on huge estates, either alone or with their spouse only. Communication is done via holographictelepresence (viewing, as opposed to seeing)
Ultimately, we find out that neighbor and fellow robotocist Jothan Leebig was working on a way of subverting the robots' inability to kill humans. Rikaine found out, and Leebig arranged for Rikaine's wife Gladia to kill him. Leebig kills himself before he can be taken into custody. Despite knowledge of her guilt, Baley never discloses Gladia's role in the murder -- in part because they have established an unfulfilled romantic relationship.
After investigating the murder to a satisfactory conclusion, Baley returns to Earth a hero. The information he brings back is invaluable to the government, which uses that information to predict that the Spacer societies are doomed.
A more thorough description of the after-effects can be found in the sequel to the Naked Sun, The Robots of Dawn.