Marvel eventually created their own film studio,Marvel Studios, released the Incredible Hulk and Iron Man, and was purchased by Disney, who ended up striking a deal recently to use Spider-Man in solo and Avengers movies.
Regarding the X-Men, it's been said Marvel and Fox were at odds with each other over the film rights, but things as of late seem to be getting better between the two companies as Marvel TV is involved with the new Fox X-Men TV series.
There has also been rumor of an Avengers and X-Men movie crossover for some time, and now the good news is that Stan Lee offers that Marvel is working on getting the rights back to the X-Men.
"Sooner or later, they're going to get the rights back to all our characters," Stan Lee said at the recent Wizard World Nashville (via Comic Book). "They're working on it, and they're still making X-Men movies and stuff. Don't worry about it. You'll get more Marvel superheroes than you'll have time to look at in the next few years."
Whether this means that Marvel is attempting to strike a similar deal with Fox over the X-Men in the same manner as Spider-Man or purchase the rights back completely is unknown. We can also guess if Marvel is attempting to get the X-Men rights back from Fox that it also means the rights with the Fantastic Four will come with it, especially considering the latest Fantastic Four movie bombed.
Now what is also unknown is whether it is Marvel Studios that is attempting to get the rights back, because it could very well be Marvel TV trying to get rights to the X-Men. Marvel Studios president Kevin Feige did state back in June there would be no X-Men or Fantastic Four coming to the Marvel movies, and said there were no discussions about it.
Marvel Studios and Marvel TV are actually two separate companies at Disney (which is why they don't crossover), and it's been said Marvel CEO/chairman Ike Perlmutter - who oversees the TV, comics, gaming and merchandising division - has wanted the X-Men and Fantastic Four rights back.
So it's possible down the line the X-Men and Fantastic Four could land at Marvel TV and not with the movies.