A: Yes, this does happen from time to time. You should probably find out more about the movie that's coming out. If it's virtually the same story, then I'd say tweak your story so it's more unique, more yours. But don't worry too terribly much about that "similar" movie. Truth is, chances are frighteningly against any novice writer selling his or her first screenplay (it could be at least a few years and several scripts before you're seasoned enough to start marketing anything), so consider your first scripts as practice runs. Just write the script you want to write...get it critiqued...do more rewrites...then more critiques. It's all about trial and error and learning from your mistakes. This is how you will learn to write that killer, saleable screenplay down the line.
And here's something else to think about: You need to complete projects you begin. I've known way too many budding screenwriters with piles of abandoned scripts in their storage bins. They start a project, get bored with it by page 30, and then simply move on to something that seems to be more enticing. DO NOT DO THIS. Just choose the story you want to tell...and tell it. Get at least a first draft completed. Believe me, it's a real psychological boost in the early stages of your career having completed scripts on the shelf. That "boost"—that psychological edge—can make all the difference in the world in the ol' screenwriting game. FINISH WHAT YOU START!
* * *