Horus and Set were brothers, but not alike. They fought and battled. The fights continue and victory is not yet claimed by either, though the Gods are with Horus.
Now Set is wise and crafty, he likes to conquer with skills and tactics that are not seen as so by others. Sets powers are that he will take what form he will and deceive both men and Gods. This is the power of Set, but the power of Horus is not the same. Horus comes from truth and honesty, deceit and falsehood are not in him. Those who gaze into the blue eyes of Horus can see the future. Both Gods and men seek Horus to learn what shall come to pass.
It was brought to the attention of Set that Ra would consult with Horus, and Set thought this would be the time to get to him and injure Horus. Set decided to take the form of a Black Pig. Fierce was his aspect, long and sharp his tusks, and his color was the blackness of the thundercloud; beastly and evil was his look, and struck fear into the hearts of men.
Then came the Majesty of Ra to Horus and spoke to him saying, "Let me look in thine eyes and behold what is to come." And he gazed into the eyes of Horus, and their color was that of the Great Green Waters when the summer sky shines upon them. And while he gazed, the Black Pig passed by.
Ra did not know that it was the Evil God, and he cried out to Horus and said, "Look at that Black Pig! Never have I seen one so huge and so fierce." As Horus looked, neither did he know Set in this strange form, and thought it was a wild boar from the thickets of the North Country, so he was off his guard and unprotected against his enemy.
Then Set aimed a blow of fire at the eye of Horus, and Horus shouted aloud with the pain of the fire, and raged furiously, and cried, "It is Set, and he has smitten me with fire on the eyes." By then Set was gone, for he had conveyed himself away, and the Black Pig was seen no more. Ra cursed the pig because of Set, and said, "Let the pig be an abomination to Horus."
To this day men sacrifice the pig when the Moon is at the full, because Set, the enemy of Horus, and the murderer of Osiris, took its form in order to injure the blue-eyed God. And for this reason also swineherds are unclean throughout the land of Egypt. The pigs are never allowed to enter a temple to be sacrificed to the gods. Their sons and daughters may not marry with the worshippers of the Gods.
The eyes of Horus were healed, and Ra gave to him the city of Pe, and he gave to him two divine brethren in the city of Pe, and two divine brethren in the city of Nekhen to be with him as everlasting judges. Horus glad and he rejoiced, and at the joy of Horus the earth blossomed, and thunderclouds and rain were blotted out.
Source: Ancient Egyptian Legends, by M. A. Murray