This sounds like relatively orthodox sociology of religion, actually. See for instance Stark and Bainbridge's 1987 A Theory of Religion, and specifically the idea of "compensators". For an overview, see Bainbridge's "Sacred Algorithms"; to quote:
In the absence of a desired reward, people will often accept algorithms that explain how to get the reward in the distant future or in some other context that cannot be immediately verified. These algorithms are compensators, in that they compensate the individual psychologically for lack of the reward. Typically, they are promises that the reward can be obtained.
Rewards vary in terms of how specific or general they are. Correspondingly, some compensators are relatively specific, for example promising cure of a particular disease or providing compensatory status for low status in society. Other compensators are more general, such as the hope for eternal life. Stark and I found it useful to distinguish magic from religion in terms of the specificity of the compensators they provide.
Magic is defined as specific compensators that promise to provide desired rewards without regard for evidence concerning the designated means (Stark and Bainbridge 1987:105). As noted earlier, religions are systems of general compensators based on supernatural assumptions. Thus, the defining difference between magic and religion, in the New Paradigm Theory, is the generality of the compensators they offer. There is no categorical dividing line between the two, and they blend into each other. Indeed, one of the chief variations among religious movements and organizations is the degree of magic (specific compensators) they offer in addition to the general compensators that define their religiousness.
That still doesn't say anything about cursing the name of God versus praising him, when in the face of adversity, which is what I'm interested in.
Hasa Diga Ebowai (["Does it mean "no worries for the rest of our lives?"" *"Kinda"*](http://www.youtube.com/watch?feature=endscreen&NR=1&v=AhxChl9bGl0)) is a song from Trey Parker and Matt Stone's "The Book of Mormon", an affectionate parody of religion in general. A lot of the comedy in that song is drawn from the unexpectedness of the reaction to adversity displayed within. Do listen to it before proceeding.
The stereotype is that, when troubled and in a position of weakness, where they have no power over their fates, humans tend to turn towards the LORD for consolation. Especially if the religion promises a good afterlife to the patient, meek and submissive, and a bad one to the defiant and insolent. Even when it doesn't (such as in most denominations of Judaism, AFAIK), people are encouraged to not "curse His rotten" name when everything goes wrong for them and they can't do anything about it (see book of Job).
The other side of the stereotype is that, the more powerful, confident and knowledgeable humans become, the less religious they become. This can also be seen on the time axis of a single individual's existence when, young, they care little about sin and the afterlife, and, old, they do nothing but pray all day to make up for all the awful stuff they did (and there might be some genuinely awful behavior in there).
So I've been trolling Wikipedia for examples of demographics and populations that would have commonly practiced the cursing of the LORD, but I only found reference to vikings doing that, in a "I won't believe in you, but I will believe in me, and live by my own strength" kind of way, which isn't exactly what I'm looking for.
Does anyone here know anything about these different ways people react to adversity, and what they mean from a rationalistic standpoint?