Google offer a splendid ad serving product called doubleclick for publishers (dfp) for most organizations it is completely free (as of July 2013, if your site served up to 90millions ads or less a month) . The following explains how to embed ad tags into your web site.
Javascript
DFP creating your first ad tags
Submitted by Anonymous user on 4 July 2013 - 12:26pm
by John McGeechan