It's very difficult to understand exactly what situation your cube is in based on your description, but I'll do my best...
Here is an online guide that tells you what you need to do http://www.rubiks.com/blog/how-to-solve-the-rubiks-cube
Side note: I solve the cube beginning with the bottom layer, so by "top layer" I am referring to the part which is currently unsolved (that may be your bottom layer?)
Based on your description, I believe you are in step four of that tutorial, completing the second layer. There are several possible situations I think you could be in (based on the confusing description), most of which are solveable. I interpret your description as there are either one or multiple pieces that are in the right places, but rotated incorrectly (or two pieces on the second layer are in swapped positions).
This situation occurs if you brought the edge piece down from the top border using the wrong algorithm mentioned on the website (or if it began in this unfortunate position). In either case, use one of the two algorithms provided on the website to bring a top piece (which belongs on top) down into the incorrect spot, the where the piece you are concerned about is currently located (which moves the correct piece back up to the top layer). Then, bring the correct piece down into its original spot with the other algorithm from the website. This time it should be rotated correctly.
Note: If this is a used or old Rubik's cube, it is also possible that at one point the cube burst or was purposely taken apart, and then accidentally put back together in a way that makes the cube unsolveable. If so, I think you would never encounter any difficulties until later in the solving process, but it's a possibility.