From the day of the Omer offering we are required to count forty-nine days. The day after this counting is complete, the fiftieth day, is the holiday of Shavuot, the anniversary of the giving of the Torah to the Jews. The counting is done out loud at night with a blessing. If one forgot to count by night but remembered by day he should count immediately but he should not make the blessing. If a person missed an entire day he must still count the remaining days but he may not make a blessing.
Because the twenty-four thousand students of Rabbi Akiva died in a thirty-three day period during the time of the counting of the Omer we are required to follow certain practices of mourning for a thirty-three day period during this time. Thus we may not cut our hair, perform weddings, or listen to music during this period. This period of mourning ends on Lag BaOmer, the 33rd day.
We are commanded by the Torah to count forty nine days starting from the second day of Passover. On the fiftieth day we celebrate the festival of Shavuot, commemorating the Giving of the Torah. This 50 day period is called "Counting the Omer." The Omer was a barley offering which was brought in the Temple on the day we start counting, the second day of Passover.
"Lag BaOmer" is the thirty third day of counting the Omer. The word "Lag" means 33 because it is comprised of the letters "lamud" and "gimmel," corresponding to the numerical values of "30" and "3."
The Omer period is a time of heightened spiritual sensitivity and growth. The closer Shavuot draws, the greater our anticipation grows for the climactic celebration of the Giving of the Torah, the watershed event of Jewish history.
However, the greater the potential there is for growth and building, the greater the potential there is for destruction. Consequently, in eras when the Jewish People have not lived up to their potential, the Omer period has become one of tragedy.
In the time of Rabbi Akiva, who witnessed the destruction of the Second Temple and who was the greatest Torah Sage of his generation, twenty four thousand of his disciples died in an epidemic. The underlying spiritual cause of the epidemic was the students' lack of respect for each other. This sad event and others took place during the Counting of the Omer. As a result, the Omer period has become one of semi-mourning in which we don't hold weddings or festivities, nor do we shave or get haircuts. But because the epidemic was suspended on the 33rd day - Lag BaOmer - Lag BaOmer has become a joyous day of celebration.
After all his students died, Rabbi Akiva "started over" and began teaching other students. One of his foremost students was Rabbi Shimon bar Yochai, the author of the Zohar. The Zohar, which means "The Shining Light," is the basis of the secret teachings of the Torah. Some people light bonfires on Lag BaOmer and sing songs in honor of Rabbi Shimon bar Yochai, who revealed the teachings of the Zohar to the world on Lag BaOmer.
According to tradition, the day that Rav Shimon bar Yochai passed away was Lag BaOmer, the eighteenth of Iyar. Even though the death of such a great sage is a sad event, there is also joy surrounding the fact that he attained his final reward (as the Zohar explains), and the fact that he revealed many deep secrets of the Torah to his students on his dying day.
The fire which surrounded the house, preventing any but Rav Shimon's closest students from approaching, serves as a basis for the custom of lighting bonfires on Lag BaOmer.