Symbolism, Imagery, Allegory
Every rose has its thorn, right? But, that doesn't mean we like pricking our fingers on them. A thorn stuck in your skin is a terrible thing. It's painful. It's like a punishment. Hmmm, maybe we can get God to do something about all this suffering?
The Thorn Within
Paul coins the term in this passage:
Therefore, to keep me from being too elated, a thorn was given me in the flesh, a messenger of Satan to torment me, to keep me from being too elated. Three times I appealed to the Lord about this, that it would leave me, but he said to me, "My grace is sufficient for you, for power is made perfect in weakness." (2 Corinthians 12:7-9)
Did Paul literally have a giant thorn sticking in his skin? Eh. It's probably a metaphor.
Historically, scholars think that the "thorn" Paul may have been referring to was some kind of disease or illness. It could have been something that affected his ability to preach and travel spreading the gospel. The thorn could also be another person, temptation, or just plain ol' sin.
Basically, since Paul doesn't explain what he's talking about, we have no clue. It's clear, though, that the thorn represents some kind of hardship or difficulty in his life. That's why the phrase often gets used by Christians to mean any kind of trouble that comes into our lives.
Thorny Issue
Paul prays three times for God to remove the thorn, but God rejects his requests. Basically, God tells him that a little suffering is good for him. Prayer denied.
Paul seems satisfied by this, and the message of the verse seems to be that, even in hardships, God is there. Those difficult situations are sometimes the things that shape us and help us grow. Hey, at if you can't beat a thorn, you might as well try to live in peace with it.
For believers and non-believers alike, the idea that God brings hardships into our lives to make us better people can be a tough pill to swallow. But it's also a recurring theme throughout the Bible (Job, anyone?) and pretty much everything that came after it.