It seems completely counterintuitive to be lonely in a relationship but, it happens fairly often. I've spoken to several people lately and this notion has come up a few times. This loneliness is a result of a disconnect between you and your partner. Sometimes this is temporary...sometimes these feelings are long term and even deepen over time. Loneliness is very disconcerting and it's hard to call it what it is since it seems so unlikely to happen in a marriage or relationship.
What can you do about it? Realize what's happening and take some action to help remedy this. Something needs to change. Since a relationship is always two people, you likely own some piece of this. Communicate. Loneliness comes from the breakdown of communication. It's time for drastic action if it has come to this point.
If you can't talk to your significant other...talk to someone. Reach out to friends. Don't perpetuate this feeling since it's not good for the soul.