I can recommend a really brilliant short science fiction story by Isaac Asimov about this. Its called Nightfall and its widely regarded as one of the greatest Sci-Fi short stories. The ending is superb and a bit of a shocker - I won't give it away (unless you really want me to).
I have found the book in the web in German „Einbruch der Nacht“. I learned it is not the short story. This novel has about 330 pages and appeared around 1990. The short story is from 1941, so far Wikipedia, Anyway I will read the novel unless you say the short story is the better choice.