How can only one valence electron in sodium cause doublet in spectrum? The valence electron in sodium atom gets excited and moves to higher orbital say $3P$ and it then comes to the lower energy state $3S$ thus there should be only one line in spectrum (regarding this particular transition). But my book says since $3P$ can exist in 2 states $3P_{1/2}$ and $3P_{3/2}$ so there are doublet in the spectrum but how can only one electron make two transitions - from $3P_{1/2}$ to $3S$ and from $3P_{3/2}$ to $3S$ ?
 A: It is not one electron making the transitions.  For each atom electrons can exist in two P states and if a transition to an S state is possible the one of quantum jumps occurs.  So when you see the spectrum doublet it is the result of these quantum jumps by electrons in different atoms.
A: 
But my book says since 3P can exist in 2 states 3P1/2 and 3P3/2 so there are doublet in the spectrum but how can only one electron make two transitions - from 3P1/2 to 3S and from 3P3/2 to 3S ?

Actually your book is saying correctly that there are two levels belonging to P-state i.e. l=1 state -its happening due to coupling of spin and orbital state of electron given by quantum numbers namely l and s respectively.
Spin orbit coupling can give those two P-state belonging to two j-values ;
namely  j= l + 1/2 and j= l - 1/2  ;With same (l=1)orbital state the 
 electron can stay in  two spin states +1/2  and -1/2 in the unit of hbar.
This gives us the two 3Pj state namely  j=3/2 and j=1/2 only.
As the energy level differ slightly for the above two j-values. The electron  has two options  to stay with definite probability i any one of them and the transitions to the 3Sj-state  leads to two emission lines  (D1 and D2) separated by approximately  5 Angstrom which we know as sodium doublet. This is clear evidence/effect of spin orbit interaction or l-s coupling.
