I very much dislike chicken and egg questions because it immediately sucks you into an argument with a creationist, most of whom simply don't get it. As Wright et al. (2015) point out the answer is clear from an evolutionary standpoint. The amniote egg, existed by the time the earliest amniotes (mammals and reptiles) diverged from one another about 325 million years ago, long before the first chicken (= birds) walked the Earth. Today, the majority of living amniotes are oviparous, including all birds, crocodylians, tuataras, turtles, and monotreme mammals. However, squamates are far more diverse in their approach to giving birth or laying eggs.
Approximately 20% of squamate species are viviparous, and this complex of traits has been estimated to evolve independently over 100 times across the squamate phylogeny. Viviparous species, developing embryos are retained in the mother's uterus for the entire duration of embryonic development. The traditional view of laying eggs or giving birth in amniotes is that the most recent common ancestor of squamates, which lived ~200 mya, was oviparous, as it inherited the same ancestral parity mode that characterizes all other reptiles.
The transition from oviparity to viviparity requires extensive modification of uterine physiology and morphology. For example, uterine shell glands in oviparous species secrete calcium during the discrete period of eggshell construction. In viviparous species, shell gland function has been modified to provide calcium to the embryo throughout gestation. True “ovoviviparity” does not exist in squamates, as all examined viviparous squamates have some form of placenta composed of both maternal and embryonic tissue.
The uterine structure of oviparous species is, therefore, modified into the maternal half of the placenta in viviparous species. The embryonic portion of the placenta is composed from the same extra-embryonic membranes that are present in all amniote eggs. Most squamate placentae are relatively simple structures used primarily for gas exchange and water transport, but a more elaborate placenta that facilitates significant nutrient exchange has evolved at least six times in squamates. Underlying the evolutionary transition to viviparity and a placenta are significant changes in gene expression of hundreds of genes.
In a new paper Wright et al. (2015) re-evaluate support for the provocative idea that the first squamates were viviparous. They test the sensitivity of the analysis to model assumptions and estimates of squamate phylogeny. They found that the models and methods used for parity mode reconstruction are highly sensitive to the specific estimate of phylogeny used, and that the point estimate of phylogeny used to suggest that viviparity is the root state of the squamate tree is far from an optimal phylogenetic solution.
The ancestral state reconstructions are also highly sensitive to model choice and specific values of model parameters. A method that is designed to account for biases in taxon sampling actually accentuates, rather than lessens, those biases with respect to ancestral state reconstructions. In contrast to recent conclusions from the same data set, Wright et al. (2015) found that ancestral state reconstruction analyses provide highly equivocal support for the number and direction of transitions between oviparity and viviparity in squamates. Moreover, the reconstructions of the ancestral parity state are highly dependent on the assumptions of each model. The authors conclude that the common ancestor of squamates was oviparous, and subsequent evolutionary transitions to viviparity were common, but reversals to oviparity were rare. The three putative reversals to oviparity with the strongest phylogenetic support occurred in the snakes Eryx jayakari and Lachesis, and the lizard, Liolaemus calchaqui. The authors emphasize that because the conclusions of ancestral state reconstruction studies are often highly sensitive to the methods and assumptions of analysis, researchers should carefully consider this sensitivity when evaluating alternative hypotheses of character-state evolution.
Wright AM, Lyons KM, Brandley MC, Hillis DM. 2015. Which came first: the lizard or the egg? Robustness in phylogenetic reconstruction of ancestral states. Journal of Experimental Zoology (Mol. Dev. Evol.) 324B:504–516.