Ok, so I haven't forgotten this question. It's been in the back of my head for the past 3 years. I think I'm starting to get a clue of the answer. There certainly is a lot going on in this passage that I don't understand, but I think that the reason James chooses this prayer of Elijah is that he wants us to know he's talking about more than physical healing.
Physical healing is a wonderful gift, but it is not an end in itself. Note that the story of Elijah raising the widow's son ends with her confession that she believes in the messenger (1Ki 16:24). Note that earlier in v18, she is aware of her sins.
However, in the end, she does not speak about repenting from those sins (neither does she refuse to repent -- she is just silent on that issue). It seems that, in this story, the bodily healing of the widow's son is to confirm that God's word is indeed in the mouth of his prophet -- nothing more and nothing less.
Contrast that with the 1Ki 18:37, "Answer me, O LORD, answer me, that this people may know that you, O LORD, are God, and that you have turned their hearts back." Sure enough, once the fire fell, "[all the people] fell on their faces and said 'The LORD, he is God; the LORD, he is God.'" And so we see spiritual healing for the nation of Israel in accordance with God's promise to Solomon in 2Ch 7:13-14.
Of course, we have to test this reading with the word for "healing" in verse 16. Here we have a problem: 19 of the 26 times this Greek word is used are in the synoptic Gospels, and always here it is clearly in the context of physical healing. The word is also used in Acts 9:34 and Acts 28:8. I think a "spiritual healing" argument might be applied in the context of Acts 10:38, Acts 28:27, and Hebrews 12:13, but I think that the context still supports interpreting "healing" in its physical sense (possibly as a contextual metaphor, but still maintaining that the word is to be understood first as being physical). The final use of this word is 1Pe 2:24, "He himself bore our sins in his body on the tree that we might die to sin and live to righteousness. By his wounds you have been healed." Here, at last, we see another instance where God is speaking primarily of something other than physical healing. In the context of this epistle, Peter speaks of healing from sin. But the apostle is also quoting Isa 53:4, where the healing is from the punishment (griefs, sorrows, piercing, crushing, chastisement) and malady (transgressions, iniquities) of sin that Christ bore. So, I believe that while this word for "healing" is most commonly used in the New Testament in a physical sense, there is sufficient evidence that it can be used with a broader intended meaning.
Finally, my response here accords well with the comment of @Nigel-J. I had responded to his comment with a number of questions, which I believe I should address here:
- Why in the middle of a progression of prayers of affliction, illness, and faults does James introduce praise for cheerfulness in verse 13b? Answer: I am not fully on board with @Nigel-J's progression. In particular, I think the paragraph break at v16 appropriately moves away from a progression of affliction, cheerfulness, and sickness/weakness, and begins the conclusion that prayer is broadly effective in many contexts -- most importantly for providing healing and salvation for wayward souls (cf. v19-20).
- Why does he change from the suffering individual praying in verse 13a to elders praying in verse 14? Answer: I think that the "suffering" in verse 13a is qualitatively different from the "sickness" in verse 14. Specifically, the term "sick" is technically the word for "weak," and is used in the synoptic gospels to describe people who were invalid, bed-ridden, or dying. Later in the Epistles, the same term is used to describe weak faith. So I think James is pointing to individuals who are weak (physically or spiritually) and they cannot pray for themselves.
- If this passage is all about the effectiveness of prayer, how does the significance of confession (verse 16a) fit in with that picture? Answer: It fits perfectly because confession is the means by which God forgives our sins, cleanses us from unrighteousness, and heals our souls (1Jo 1:8-10).
Ok, so that's a long answer, but it's taken a few years to put it together. I welcome any and all comments, questions, criticisms. Please hold me accountable, and let me know if I'm missing something here.