When all options of a spread expire in the same month, the risk graph at expiration consists of straight lines. If some options expire in later months, some or all of the graph, at first expiration, has curved lines. How is the graph generated in the latter case? Is there a variant of the Black-Scholes formula that gives the value of an option at a time before expiration?

That is the sole value of the Black-Scholes formula--at expiration, the option's value is readily computed. At expiration, a stock is at $7, the option is a $5 call. Option's worth is $2. A week before expiration, things are dependent on probabilities.

Let me guess at how software that draws risk graphs do it for positions that have legs that are not expiring. It is only necessary to be able to do this for a single leg since the risk graphs add. For a single leg, you assume the current IV of the option and use it as the volatility input to your pricing formula and let the variable for the underlying vary all over the place. The time to expiration is determined by the date the risk graph is for. Thus you get a whole bunch of values on the risk graph. Some sort of interpolation formula is then used to fill the graph in for the other points. Is there somebody here who knows if this is how they do it? Thanks.

Exactly right. Some charting software will allow you to change the IV, but otherwise, it will imply it from the current bid/ask.