Most shows set aside tickets for same day performances. There's a TKTS booth at Times Square where you can buy them half price. Although the line looks long, it tends to move quickly. You can usually get shows that have been running a long time (Lion King, Rock of Ages, Chicago, Wicked)...