Fan-fiction is media piece that is based on the work of another. Some argue that this is stealing and pointless, while others argue it is a good practice in character-development and keeping to a consistent setting. Curiously, many of our modern classics are actual what may be considered fan-fiction.
The Aeneid by Virgil is based off Homer's The Iliad.
Most of the pieces we have left of King Arthur and his Knights could easily be considered fan-fiction. Sir Gawain and the Green Knight and Le Morte d'Arthur being the most prominent. But as anybody knows there are tons of rewrites, including Marion Bradley Zimmer's The Mists of Avalon, where the story is retold by the females.
Modern retellings are quite popular. One that received notariety only a few years ago was Wicked by Gregory Maguire, which is based on the popular Oz series by L. Frank Baum. One of my personal favorites is The Looking Glass Wars by Frank Beddor, where Alyss gets lost on earth, which is the opposite of the original by Lewis Caroll Alice in Wonderland and Through the Looking Glass.
There are any number of works purposely meant to portray the Bible in all different media. From Ben-Hur to The Life of Brian.
If this happens to interest you, a more comprehensive list was put together by user Bookshop on Livejournal.