The song is in the key of E, on the second line, you are playing the fifth (V) chord of E, which is a B.

Remember your major scale! So for Emaj, it goes, E F# G# A B C# Eb E', which correspond to chords i-ii-iii-iv-v-vi-vii.
ii-v-i is a very very common chord progression. Expect to see it a lot.
A for that 'rogue' D in the 2nd example, the line of text mentions that it is going to be taking the normal triad, which as you said would be F A C and add the 6th. The 6th of F is a D.
Hope thats helps. If your book doesn't cover major scales, check out the links at the top of the forum. There is/was an excellent read on chord construction by a guy called Jazzbo. I'd also recommend Ed Friedland's Building Walking Bass Lines for an introduction to chord progressions and understanding!!!