AAUI, it does not quite work like that. The justices sit around a table together and discuss the points of a given case. They do not “cast a ballot” in the sense we are familiar with. They reach a majority decision, kind of similar to how a jury works. Then one or more justices write a majority decision that explains their reasoning, while there is often/usually a dissenting opinion written as well.