The theory here outlined attempts to relate the problem of the origin of the solar system to the general problem of star formation. Reasons are given for concluding that interstellar material in which stars are about to be formed consists of fragments (`floccules') moving at random amongst themselves and probably composed mainly of molecular hydrogen, the temperature being about 50 $^\circ$K and the random velocities about 1 km/s. Many stars would then be formed simultaneously, each by the aggregation of portions of material that happen to be moving together. The process producing condensations that grow into stars would also produce minor condensations in material that becomes trapped in the growing gravitational fields of these stars, i.e. planetary systems associated with the stars. It appears to be consistent with this general picture to suppose that the solar system was formed in a region whose radius was about the initial mean free path of the `floccules', and that it accounts for the amount of material originally within this region and for the amount of angular momentum originally possessed by the material in consequence of its random motions. The hypothesis is made that the mass, size and number-density of `floccules' are such that in this way the total mass, radius and angular momentum of the actual solar system are reproduced, thus leaving no free parameters. The particular region considered is centred upon that particular incipient condensation that is destined to grow into the sun. The process of growth is considered and it is shown that, on account of the randomness in the directions from which the material arrives, the resulting sun would have about the right angular momentum. Therefore there would remain in the region a certain amount of material moving at first in randomly disposed orbits about this sun and still carrying most of the original angular momentum. This system would flatten out towards its invariable plane; in order to retain the angular momentum, its final mass must be about that of the actual planetary system. The production of condensations in the material yields a number of these each not greatly in excess of the critical mass for gravitational contraction This is found to be about the average mass of the actual planets and so this, and about the right number of planets, is accounted for. The Roche limit for the estimated initial density of the planets so formed is at about Jupiter's orbit; thus the theory requires a differentiation between planets formed outside and inside this distance. It also suggests that when the planets were first formed the sun's tidal action was for a time sufficient to keep them revolving with `the same face' towards the sun; conservation of angular momentum during subsequent gravitational contraction would ultimately require faster axial rotation. It is shown that this may account for the direct axial rotations of the actual planets. The times for the various stages are roughly estimated and it appears that the duration of the entire process would be some 2 x 10$^5$ years. Finally, it is pointed out that, if the theory be taken in the first place as no more than suggestive, it would suffice strongly to indicate that the sun's actual angular momentum is most simply accounted for by supposing it to have been produced by the assembling of portions of material of about the mass considered, while the planets' actual masses are most simply accounted for by supposing them to have been produced from portions of about the density considered. Thus not only would the quantitative hypotheses be checked, but the essentials of the theory would be recovered.