Preheat oven to 350°.
Remove white papery skin from garlic heads (do not peel or separate the cloves). Wrap each head separately in foil. Bake at 350° for 1 hour; cool 10 minutes. Separate cloves; squeeze to extract garlic pulp. Discard skins.
Combine garlic pulp and remaining ingredients except cooking spray in a blender or food processor; process until smooth. Pour garlic mixture into a shallow 1 1/2-quart baking dish or gratin coated with cooking spray. Place dish in a large baking pan; add hot water to pan to a depth of 1 inch. Bake at 350° for 30 minutes or just until set in the center. Remove from pan; cool briefly on a rack. Serve warm or at room temperature.