This is reminiscent of a classic story by Ray Bradbury called "The Long Rain" (1950), which has been anthologized many times. Check out its listing at the ISFDB to see if any of the covers look familiar. Here is the plot summary from Wikipedia.
The story is set on Venus in a jungle, where a group of four men whose rocket has crashed are attempting to reach the safety of a Sun Dome. Bradbury portrays Venus as having nearly eternal rains. Earth colonists depend on the Sun Domes, lit and warmed by a miniature sun and filled with provisions, to keep from going insane. There are over 120 of these domes, but the indigenous Venusians destroy them when they can. The men are led by a character who is only identified as "the Lieutenant". One of the men is killed by a lightning strike when he tries to run; as the others remark, "he shouldn't have jumped up" during an electrical storm. The three remaining men make their way to a Sun Dome, but find that it has been destroyed by the natives and offers no shelter from the rain. One of the men becomes despondent and stops responding, instead staring up into the rain. He is shot by Simmons who defends his actions as a mercy killing, preventing the man from slowly drowning as his lungs fill up with rain. As Simmons and the Lieutenant continue on to where they think the next Sun Dome should be, Simmons believes that he is also going to go insane before they reach safety, and so commits suicide. The Lieutenant continues on, and finally reaches the Sun Dome where he is warm and safe, with dry clothing and hot chocolate. That said, by this point in the tale, the Lieutenant may not be a reliable narrator. Given the story's original title (Death-by-Rain), and the fact that all the other characters die by succumbing to the rain's sanity-attacking events, it is highly possible that he is hallucinating.