Prepare pastry. Mix sugar and flour. Alternate layers of apples cranberries and sugar mixture in pastry lined pie plate, beginning and ending with apples. Dot with margarine.
Cover with top crust that has slits cut into; seal and flute. Cover edge with 2 to 3 inch strip of foil to prevent excessive browning; remove foil during last 15 minutes of baking. Bake until crust is golden brown and juice begins to bubble through slits in crust, 40 to 50 minutes.