It sounds like what you're looking for is in-text advertising. I'm not aware of a script that enables you to adminster it yourself, but if you have a hunt around on Google you might find something. On the other hand, you might find this article, which is strongly critical of in-text advertising, and the comments at the bottom suggest that as well as being unpopular with visitors, it isn't particularly profitable either (of course, that could be because the third party system provider is taking a hefty cut).
What I know from my own experience is that such scripts tend to absolutely hammer the page performance, making it really slow and clunky. When I get that, I lose most/all of my respect for the site that's selling out on its visitors for a quick buck, given that there are plenty of other advert formats that are less intrusive and less disruptive.