Preheat the oven to 325°F. Coat a 13x9-inch casserole with vegetable cooking spray. In a large bowl, cream together the margarine and sugar. Beat in the eggs, one at a time, until well blended. Stir in the ham, pineapple, and lemon juice, and fold in the bread cubes. Pour the mixture into the prepared casserole and smooth the top. Bake, uncovered, for 30 to 35 minutes, or until the custard is set and the top is golden.