Any object in a liquid/substance will experience a force called upthrust. This force is not dependent on the weight of the object, rather the amount of volume it takes up within the substance. When the object enters the substance, it will take up space that was previously filled by the substance. So the weight of the amount of substance that was replaced by the object will now become the upthrust force on the object. Depending on whether this force is larger/smaller than the weight of the object itself, the object will rise or fall. In terms of this question. The bubbles are the object and the magma the substance. The upthrust will be equal to the weight of volume displaced which is the weight of the magma with a volume of the bubble. In this case the weight of the gas for that particular volume is significantly less then that of the magma, therefore the net force is upward and the bubble rises. If the bubble expands, then it takes up more volume. This means the weight of magma displaced increases so the upthrust force is larger with an insignificant increase in gas weight. So the net force is larger and the gas bubble rises faster.