This is, of course, a matter of opinion. We can never hope to prove that the decision was the best possible. However, I would definitely argue that it was the best choice for the US. I would even argue that it was, overall, better for Japan.
If the US had not dropped the atomic bombs, Japan would not likely have surrendered without an invasion. An invasion of the Japanese home islands would have been unimaginably bloody. The Japanese had defended islands like Saipan, Iwo Jima, and Okinawa (which were not even part of the core of the Japanese homeland) furiously. They had incurred large numbers of casualties on the Americans even though the islands were tiny when compared with any of the main islands of Japan. Moreover, they had defended those islands almost literally to the last man.
What this tells us is that millions of Americans and Japanese would have been killed or wounded in an invasion. The US military estimated that it would take 1 million casualties if it invaded. The toll on Japanese life would surely have been higher as the Japanese government was starting to train the citizenry to resist the US invasion, including through suicide attacks.
There was no other way to end the war quickly. Therefore, in my view, dropping the bombs was the right thing to do.
It is also important to remember and emphasize the fact that both the Japanese government and general public were warned, repeatedly and in very specific terms, about the impending use of atomic weapons by the American government. We even listed the cities that we intended to attack and informed their residents that these attacks were imminent. After the first bomb was dropped on Hiroshima, warnings continued to be issued, and the Japanese public were encouraged to ask about Hiroshima if they doubted the existence or power of the bomb.
While it's an argument in semantics to say that this "absolved" the United States of "guilt" for the use of these weapons, it cannot be said that this decision was made callously or without regard for the lives and post-war effects the bombs would have on Japan.
Some have claimed that there were other morally preferable ways to end the war in the Pacific. However, these claims are more than unjustified since it suggests that the morally better way to end the war was to continue relying on the Allied blockade, which would have starved the Japanese masses to death. Similarly, a bombing offensive was impossible as most of the infrastructure in Japan was already gone - in fact, Hiroshima and Nagasaki had been chosen as the targets as they were the only cities that were relatively intact in Japan. Any attempt to invade Japan would have only resulted in an Asia-wide bloodbath and a staggering number of casualties, prolonging the war. Therefore, there seemed to be no other viable alternatives to turn to, which could provide a quick end.