What do you do when you've got an awesome story, but the ending eludes you? All the ingredient are there: great beginning and middle, but the end just is not coming. What do you do?
I just start writing it, hoping a good ending will occur to me in the process. You have to have faith in yourself.
This, pretty much. You'd be surprised what route your story ends up taking, and what might occur to you in the meantime.
Every story I've ever finished got finished because I knew the ending up front, but... Based on some ideas I've read over the years in various 'how-to' books: go back to the beginning to refresh your memory about where your MC was ATT, figure out the diametric opposite of that (if s/he was poor and starving, at the end s/he will be rich and feeding the poor; something like that), find a way to make that ending come about and write it, go back through the story and plant whatever you need to plant to make the story work, and finally: rewrite (because by now, it's going to be a mess).
I agree with @minstrel. Whether you are a planner or a pantser, you don't need to have everything planned out and know what's going to happen at every twist and turn. Just start writing what you know. As the story grows you will probably learn more about what it's really about and what must happen at the end. Writing is a long process, so take one step at a time. Also, don't be afraid to write a mediocre ending, or a bad ending, or an ending that you are so ashamed of that you just want to delete it. As long as you have something down on paper, something to work on, you are making a lot of progress.
I'd say let it cook a while while you think about it in your subconscious. Go work on something else in the meantime. Have faith that the solution will come to you.
If I don't have anything when I start writing, something usually comes to me in the process. If that doesn't work out and I'm struggling to end it, sometimes it helps me to just keep writing well past the point I feel like the ending should be somewhere around - ending on a completely off beat can help pinpoint where and what it actually needs to be. You know when you're watching a movie and it drags on and you end up thinking "If they'd just ended it after that scene, it would be so much better"? Do that to yourself. Another method I use is just to think critically about the story and what kind of ending would fit the theme or tone of it. Should it be uplifting or bittersweet or flat-out depressing? I'm a big advocate of treating writing as a craft that you actively work on and not some abstract art where you have to wait on a muse to tell you what to do. What emotion do you want your readers to come away feeling and what kind of ending will produce that emotion? What kind of ending fits best with the rest of the story? Once you have a general idea of what you need, you can work towards the specifics. I had a short based on a myth about an endless battle. It's not happy stuff, and I wasn't interested in giving it an overtly happy ending - it wouldn't've fit. But I didn't want it to be a complete downer, either, because I didn't see the point in that (I think we all know that war is bad and death is sad already, right?). I fought with this short for several days before deciding that the best ending was one implying that the cycle would be broken soon - almost everyone would finally die, but the repetition would be over and those who weren't fated to die would finally be free. Initially, I didn't at all consider this ending - I was stuck on happy end (everyone's saved somehow) / sad end (everyone dies or continues to suffer ad nauseam). So it also really helps to make yourself think outside the box.