Firstborn males have a custom to fast on Erev Pesach to commemorate the miracle performed for them: all Egyptian firstborn males died while firstborn Israelites were saved.
In order to give some sense of the significance of Makati Bekhorot (the Plague of the Firstborn), we must first note that besides being the eldest male child, the firstborn embodies something primal, for with his birth the new life of the next generation begins to unfold. The firstborn thus bears great responsibility. If he chooses the path of virtue, he will express that primal root – faith in the Creator of the universe – and the rest of the children in the family will follow in his path. But if he chooses the path of evil, denying God and viewing himself as great and significant, he will always be striving to enhance his own glory and satisfy his appetites. This was the sin of the Egyptians, who considered themselves the lords of the earth and denied God’s existence. When they were commanded to send Israel away to worship God, they stubbornly refused to let them go. Pharaoh, himself a firstborn, led them in their pride and heresy.
The first day of Pesach is itself a kind of “firstborn”: it is the first day on which God began to reveal Himself in the world. Until this time, individual miracles were performed for special people, but not on a national level, via an entire people, the people of Israel. When the great day arrived, the day designated for the revelation of the root of faith in the world, a severe accusation against the firstborns of Egypt, who denied God’s existence, was aroused. Upon God’s revelation at midnight, they were all broken and slain. In contrast, the bekhorim of Israel, who expressed their faith in God by obeying His commandment, on the eve of the Exodus, to slaughter a lamb, which was an Egyptian god, risking their lives by smearing its blood on the doorposts, were saved and sanctified.
Each year, we relive the special time of Seder night, when the source of our faith was revealed. However, as this holy night approaches, the accusation against the bekhorim is reawakened: are they as committed to the Torah and the mitzvot as they should be? Are they expressing God’s name in the world as they should? Firstborns therefore have a custom to fast and repent on Erev Pesach.
This fast is less strict than other fasts. All of the other fasts were instituted by the Sages, but Ta’anit Bekhorot, a custom adopted by many bekhorim, was never instituted as a binding obligation by the Sages. It is therefore customary to be lenient. For example, if one suffers from a headache, or from a pain in his eye, he is exempt from Ta’anit Bekhorot, even though he is not considered sick and would not be exempt from other fasts. Likewise, if one thinks that by fasting he will not be able to fulfill the mitzva of eating matza and recount the story of the Exodus, it is better that he not fast. Furthermore, the custom is that whoever participates in a se’udat mitzva is exempt from Ta’anit Bekhorot (Birkei Yosef §470; MB 470:2, 10).
 Y. Pesachim 10:1 has two versions of this. According to one version, the custom of the firstborns is to fast on Erev Pesach; this also appears in Sofrim 21:3 (compiled at the end of the Savoraic period in Eretz Yisrael). This is also the version quoted by Ramban and Ran. According to the second version of the Yerushalmi, they did not have the custom to fast; this is the version quoted by Raavya and is also the opinion of the Vilna Gaon. Meiri states that the custom in Germany and France was to fast, although the fast was not mandatory, and Birkei Yosef quotes Rishonim who echo this idea. Therefore, one may be lenient about this fast and rely on a siyum in order to eat. Mordechai states in the name of Rabbeinu Yechiel that the custom of the firstborns is only to refrain from eating bread and other baked goods, but meat, fish, fruits, vegetables, and the like are permissible. Practically, SA 470:1 states that the custom is to fast. However, MB 2, SHT 6 ad loc. state that when necessary, such as if the firstborn has great difficulty fasting, one may rely on Rabbeinu Yechiel. The book Ta’anit Bekhorot discusses all of the opinions and laws in this matter; see Yabi’a Omer 1:25 for a shorter summary.