I was wondering if the sun's radiation affects the gravity when it passes through space? Like can radiation strengthen or weaken the force of gravity?

As Zephyr points out below, the term "exerting gravity" is not really the correct way of describing gravity. In general relativity, objects are assumed follow straight lines in space, unless a force (e.g. electromagnetic) acts upon it. What we interpret as "gravity" is the deviation from what we think is "straight ahead", caused by a geometrical change in the space (and time) — and thus in the mathematical rules we use to calculate e.g. how parallel lines behave, how many degrees there are in a triangle, etc — around a massive object. The deformation of space is given by the Einstein field equations, in which the so-called stress–energy tensor appears. This is a mathematical object consisting of 16 numbers, of which one number (the "$T^{00}$'th component") holds the energy density of everything, i.e. radiation, dark matter, dark energy, stars, planets, bicycles, and — in particular — your mom.