No, they were actually triplets! The third one came on to play Thomas Riker in the 7th season episode "Second Chances"
Riker grew a beard because the real Jonathan Frakes died in a plane crash between seasons one and two. Thankfully, Frakes's bearded twin brother, Jerry Frakes, agreed to step into the part, but asked to be billed in his brother's name, as a tribute. He agreed to play Riker exactly as his late brother did, but with one stipulation. He asked to keep the beard he had grown which was the only way his family could tell the two brothers apart. Roddenberry agreed.
Nonono. You have it all wrong. Jonathan Frakes was presumed dead and replaced by Jerry Frakes after season 1. Several years later Jonathan Frakes reappeared after hanging out with Al Gore in the mountains. He complained that they had recast his part and demanded the role of Riker back. The authors came up with the Thomas Riker scenario to satisfy Jonathan's demands while also allowing them to keep Jerry in the co-starring role.
On a serious note...does starfleet even allow beards??? I can only remember seeing one other plus Sisko's goatee (and Geordi's lame attempt) in modern Trek. And if there is a regulation against it how did Riker get away with it?