Pharez was not ILLIGITAMATE! He was the son of Onan of Liviriate Marriage.(all errors in original) This is rather confused. The real situation is this:
1) Judah had three sons (at first) whose names were Er, Onan, and Shelah.
2) Judah married Er to a woman named Tamar.
2) Er did something wicked in God's sight (we're not told what that was) and God slew him.
3) Judah commanded Onan to raise up seed to Er by knowing Er's widow, Tamar (this is our first example of the implementation of the levirate law, which was later confirmed by Moses).
4) Onan knew Tamar but avoided raising up seed by spilling it on the ground.
5) God was angry with Onan for doing that and slew him.
6) Judah was afraid that if he gave Shelah to Tamar to raise up seed to Er that Shelah also would be slain, so he invented an excuse and did not give Shelah to Tamar to raise up seed to Er and meanwhile Tamar continued to live in Judah's household.
7) Some time after that, Judah's wife (the daughter of Shuah) died.
8) Judah went out of town to go sheer sheep, and news of it came to Tamar.
9) Tamar went and disguised herself as a prostitute along the road where Judah was going.
10) Judah fell for the bait without knowing it was Tamar, and she received some personal items from him as a pledge for the payment (in the form of a kid of the goats) he was supposed to give her.
11) Several months later, Judah found out that Tamar was pregnant and was going to have her executed for harlotry.
12) At that point she revealed whose child it was by the pledges Judah had given her, and so Judah did not execute her.
13) That conception produced twins: Pharez and Zarah.
(see Genesis 38)
The relations between Judah and Tamar were not legitimate relations. She was his son's widow, and consequently it was not proper for him to know her in the way that he did. It was also not proper for them to engage in relations as harlot and customer. Their children were not legitimate children born within a marriage. While Tamar was essentially trying to use the levirate principle to raise up seed to her dead husband Er, it was not an appropriate or blessed union. Consequently, while Judah spared her life (he could hardly kill her for being a prostitute without condemning himself as well), Scripture never refer to Pharez as the son of Er, but always as the son of Judah.
The anonymous commenter tried to bolster his case with the following comment:
Next time, use a decent Bible like the Septuagint Version instead of the pathetically deficient Geneva Bible, whose sole object was not to give the actual Bible Translation but to expound Calvinism.a) I generally use the KJV, not the Geneva Bible.
b) The Geneva Bible was actually a Bible translation, not simply Calvinist propaganda.
c) The Septuagint is not really an alternative to the Geneva Bible since (1) it is not in English and (2) it is only of the Old Testament. On this particular passage, the Septuagint does not vary from the KJV/Geneva Bible as far as the text goes.