Randal Rauser has been discussing the problem of the Canaanite genocide and whether God had really commanded it. Rauser's view is that God would never have commanded such a thing, and so we should reject the view that the Bible has accurately recorded what God had to say about it. C.S. Lewis would seem to agree with him:
"Dear Mr. Beversluis,
Yes. On my view one must apply something of the same sort of explanation to, say, the atrocities (and treacheries) of Joshua. I see the grave danger we run by doing so; but the dangers of believing in a God whom we cannot but regard as evil, and then, in mere terrified flattery calling Him ‘good’ and worshiping Him, is still greater danger. The ultimate question is whether the doctrine of the goodness of God or that of the inerrancy of Scriptures is to prevail when they conflict. I think the doctrine of the goodness of God is the more certain of the two. Indeed, only that doctrine renders this worship of Him obligatory or even permissible.
To this some will reply ‘ah, but we are fallen and don’t recognize good when we see it.’ But God Himself does not say that we are as fallen as all that. He constantly, in Scripture, appeals to our conscience: ‘Why do ye not of yourselves judge what is right?’ — ‘What fault hath my people found in me?’ And so on. Socrates’ answer to Euthyphro is used in Christian form by Hooker. Things are not good because God commands them; God commands certain things because he sees them to be good. (In other words, the Divine Will is the obedient servant to the Divine Reason.) The opposite view (Ockham’s, Paley’s) leads to an absurdity. If ‘good’ means ‘what God wills’ then to say ‘God is good’ can mean only ‘God wills what he wills.’ Which is equally true of you or me or Judas or Satan.
But of course having said all this, we must apply it with fear and trembling. Some things which seem to us bad may be good. But we must not consult our consciences by trying to feel a thing good when it seems to us totally evil. We can only pray that if there is an invisible goodness hidden in such things, God, in His own good time will enable us to see it. If we need to. For perhaps sometimes God’s answer might be ‘What is that to thee?’ The passage may not be ‘addressed to our (your or my) condition’ at all.
I think we are v. much in agreement, aren’t we?
Yours sincerely, C. S. Lewis"
(I'm not sure, but I think this was taken from an appendix to John Beversluis's book, C.S.Lewis and the Search for Rational Religion .)
UPDATE: The letter is from Chapter 9, "Grief," p. 156-157, of Beversluise's unrevised edition of his book, which I don't recommend. I've heard from many that his revised edition is much better.