That's happened to me a few times...overall, in and near the pattern, I'm equally surprised at how easily I spy traffic sometimes and by how difficult it can be to see other aircraft at other times. They just don't jump out at you, especially the white ones.
I've had planes take the active when I'm on final, despite my radio calls and my usual M.O. of lighting up everything available when I'm in the pattern...but I've never had trouble seeing THAT in time!
It really is all about where your attention is focused, and how rigidly it's focused... the time I was about to touch down and my instructor said "what the-?!" and I looked up to see an opposing aircraft landing long the other way, I realized that both of us (scary thought) had been too focused on the touchdown point.
I was lucky- that important lesson didn't cost me anything.