Summary:

To target a city with a ranged unit, move the unit so that the city falls within the unit's range and then right-click on the city. Depending upon the power behind the attack, the city's hit points may be reduced by the attack. (The attacking unit is not damaged, of course.) Note that a ranged attack cannot drop a city below 1 HP; the city must be captured by a melee unit.