We describe a method to measure the solar scattered UV radiance and trace gases in the upper troposphere and stratosphere using a spectrograph carried by high-altitude balloons. The flights have been conducted over tropical regions near urban areas. The instrumentation was developed using off-the-shelf components and can be easily reproduced. We describe the design of the instrument, its operation in flight and discuss some flight result. Observations of the scattered solar radiance were performed by looking towards the Earth's limb at Sun angles of more than 90 degrees at altitudes of 10 to 29 km. This method allows us to estimate the variation of the scattered UV solar radiance with height. It also can be used to measure the column densities in the upper atmosphere.