Similar to the Debye-Hückel plasma, charged groups in solutions of rigid rod polyelectrolytes attract each other. We derive expression for the correlation free energy of electrostatic attraction of the rods within the random phase approximation. In this theory, we explicitly take into account positions of charged groups on the chains and examine both charge and polymer concentration fluctuations. The correlation free energies and the osmotic pressures are calculated for isotropic and completely ordered nematic phase. The results of the discrete model are compared with results of a continuous model. The discrete model gives rise to a stronger attraction between the charged groups both in the isotropic and nematic phases and to a stronger orienting action of the electrostatic forces.