Foundations of Computer Science, C edition by Al Aho and Jeff Ullman:
A superb book that's theory oriented. It's probably suited for programmers who are a little more experienced, but I'm a beginner, and this book served me quite well. It's probably one of the best books in its class. Best of all, it's free!