NStar ( NST) rose 4% Friday after saying its second-quarter earnings rose 37.7% from a year ago. The Boston-based energy company earned $45.7 million, or 43 cents a share, in the quarter, compared with $33.2 million, or 31 cents a share, a year ago. Analysts surveyed by Thomson First Call were expecting earnings of 39 cents a share in the most recent quarter. Second-quarter revenue rose 13.4% from a year ago to $784.6 million. The company expects earnings in the upper end of $1.90 to $1.96 a share for the year 2006, and analysts are expecting earnings of $1.95 a share. NSTAR raised its longer-term earnings per share growth estimate to 6% to 8% from 4% to 6%. Shares rose $1.07 to $31.26.