Pharez the literal second son
At the time of birth, of the twins Pharez and Zarah, Zarah had stuck his hand out first. The midwife declared that Zarah was first. 
Pharez the riddle second son
Zarah pulled his hand back and Pharez was born first. He became a usurping second son and obtained the promise and inheritance.
Though the midwife had declared Zarah to be first, she tied a scarlet thread on his wrist. The Hebrew word for 'scarlet' שׁני shaniy also means 'second'. She declared by her actions that he was second. The metaphor for scarlet is 'sin'.  Appropriately the first son, representing Christ before the cross, bore our sin figuratively.
Though his name פרץ Perets means 'breach' the letters spell out 'the mystery פ revealed ר in the cross ץ'. His brother's name זרח Zerach means 'dawning' and together they are 'breaking forth of dawning'. Jesus was called Dayspring.  as hint of Resurrection morning. They survived the threat of death (while in Tamar's womb) to spring forth in resurrection.
Matthew points out that Parez and Zarah were of Tamar. Details matter. Some mock the idea that every detail is important as if God would blab on about trivial things. Tamar means 'palm tree' but contains the meaning 'the end ת of death מר mar'. The breaking forth of the dawning; resurrection morn, was the end of death. 
Next: Prostitute/virgin bride
- Ge 38:28 And it came to pass, when she travailed, that [the one] put out [his] hand: and the midwife took and bound upon his hand a scarlet thread, saying, This came out first.
- Isa 1:18 Come now, and let us reason together, saith the LORD: though your sins be as scarlet, they shall be as white as snow; though they be red like crimson, they shall be as wool.
- Lu 1:78 Through the tender mercy of our God; whereby the dayspring from on high hath visited us,
- Joh 11:26 And whosoever liveth and believeth in me shall never die. Believest thou this?