Most of the major lore is found in the rule books and codices (army books). That's where you read about all the major incidents that made the galaxy the shape it is in today. What makes 40k lore so fascinating is the way it is spread about across many books spanning over two decades. For example I decided to read the lore in Codex: Necrons on a bit of a whim, I hadn't had any interest in the army but I'd run out of other stuff to read and a mate offered to lend it to me. To my surprise it detailed the origin of life in the galaxy, the creation and purpose of the eldar and orcs (amongst others) as well as the unforeseen emergence of Chaos due to these tinkerings with warp space. To my knowledge this is the only place where these things are explained in such detail, they're barely eluded to in other sources.
Anyhow, the 40k wiki has a good collection of lore. If you want some good background info for playing the upcoming game I'd recommend these pages:-
The galaxy, featuring the "in the beginning" story I mentioned earlier. Not strictly necessary but it has some great background fluff.
The Imperium of Man is the dominant force in the galaxy and beset on all sides. I'd recommend reading at least down to the end of the history and if you have the patience explore some of the organisational details.
Space Marines - the introduction to this article lays down what it is to be a space marine very well, the history is essentially what you read in the Imperium's history (every Imperium-based codex and rulebook features sections entitled "the dark age of technology", "the age of strife", "the great crusade" and "the horus heresy") with subtle variations but the lore surrounding marines is deep and this article contains a lot of information about their recruiting practices, trials and enhanced physiology. You should definitely read about the
bolt-gun too.
Ultramarines! The poster boys of the Astartes, praised for being the purest, most ethical and most true to the ideals of the Codex Astartes (written by their primarch), reviled for being the most boring of all space marines. Ultramarines are actually an incredibly flexible force with a long and glorious history. Note the first 2 paragraphs of the "Horus Heresy" section contain spoilers for the Horus Heresy series of novels, and the section entitled "The Defenders of Ultramar" relates the events of the Ultramarines trilogy.
Orks - you're going to be killing a lot of these and they have some really cool background.
Chaos Marines - if it's worth making a game of, odds on chaos will turn up at some point to F S up.
If you're after some novels to read, Dan Abnett's "
Gaunt's Ghosts" series is a great way to start. Detailing the exploits of an Imperial Guard regiment during the Sabbat Crusade it starts off as "Sharpe in space" whilst the author gets to grip with the universe and develops in to some brilliant military sci-fi that practically redefined the 40k universe. Abnett also wrote two great Inquisitor trilogies -
Eisenhorn (Xenos, Hereticus and Malleus) describes the fine line an inquisitor walks between destroying heretics and becoming one whilst
Ravenor (Ravenor, Ravenor Returned and Ravenor Rogue) delves in to the seedy underbelly of the Imperium.
There are also a couple of dozen books exploring the various space marine chapters (though some series carried on so long the lore - and even author - changed part way through, and we never did find out how Ragnar joine the Wolf Guard) and the Horus Heresy series is a bit of a rambling journey through the times of the Imperium's greatest catastrophe. Currently up to 16 books, set to expand to 21 in the next year.